Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. public class User
  2. {
  3. public int Id { get; set; }
  4. public string Name { get; set; }
  5. public string Email { get; set; }
  6. public string Username { get; set; }
  7. public string Password { get; set; }
  8. public DateTime Created_at { get; set; }
  9.  
  10. public ICollection<Device> Devices { get; set; }
  11. }
  12.  
  13. public class Device
  14. {
  15. public int Id { get; set; }
  16. public string Name { get; set; }
  17. public string Type { get; set; }
  18. public string Gateway { get; set; }
  19. public DateTime Created_at { get; set; }
  20.  
  21. public int User_id { get; set; }
  22. public User User;
  23.  
  24. }
  25.  
  26. HasMany(t => t.Devices)
  27. .WithRequired(t => t.User)
  28. .WillCascadeOnDelete(true);
  29.  
  30. The expression 't => t.User' is not a valid property expression. The expression should represent a property: C#: 't => t.MyProperty' VB.Net: 'Function(t) t.MyProperty'.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement