Guest User

Untitled

a guest
Aug 17th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. How to add primary key to component table with Nhibernate?
  2. public class Address
  3. {
  4. public int Number { get; set; }
  5. public string Street { get; set; }
  6. public string City { get; set; }
  7. public string PostCode { get; set; }
  8. }
  9.  
  10. public class Person
  11. {
  12. public int Id { get; set; }
  13. public Address Address { get; set; }
  14. }
  15.  
  16. public PersonMap()
  17. {
  18. Id( x => x.Id );
  19. Component(x => x.Address, m =>
  20. {
  21. m.Map(x => x.Number);
  22. m.Map(x => x.Street);
  23. m.Map(x => x.City);
  24. m.Map(x => x.PostCode);
  25. });
  26. }
Add Comment
Please, Sign In to add comment