Guest User

Untitled

a guest
Jan 17th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. class MyObject{
  2. public String Name;
  3. public String Value;
  4. }
  5. //Mapping
  6. Id(x => x.Name)
  7. .Length(255)
  8. .Unique();
  9. Map(x => x.Value);
  10.  
  11. class ObjectHolder{
  12. public UInt64 Id;
  13. public ICollection<MyObject> MyObjects;
  14. }
  15. //Mapping
  16. Id(x => x.Id)
  17. .GeneratedBy.Native();
  18. HasManyToMany(x => x.MyObjects)
  19. .AsSet()
  20. .Cascade.SaveUpdate();
  21.  
  22. class MyObject{
  23. public UInt64 Id;
  24. public String Name;
  25. public String Value;
  26. }
  27. //Mapping
  28. Id(x => x.Id)
  29. .GeneratedBy.Native();
  30. Map(x => x.Name)
  31. .Length(255)
  32. .Unique();
  33. Map(x => x.Value);
Add Comment
Please, Sign In to add comment