Guest User

Untitled

a guest
Nov 25th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. public class Person
  2. {
  3. public Guid Id { get; set; }
  4.  
  5. public string Name { get; set; }
  6.  
  7. public List<WorkItem> Tasks { get; set; }
  8. }
  9.  
  10. public class WorkItem
  11. {
  12. public Guid Id { get; set; }
  13.  
  14. public string Description { get; set; }
  15.  
  16. public Person Creator { get; set; }
  17.  
  18. }
  19.  
  20. CreateTable(
  21. "dbo.WorkItems",
  22. c => new
  23. {
  24. Id = c.Guid(nullable: false),
  25. Description = c.String(),
  26. Creator_Id = c.Guid(),
  27. })
  28. .PrimaryKey(t => t.Id)
  29. .ForeignKey("dbo.People", t => t.Creator_Id)
  30. .Index(t => t.Creator_Id);
  31.  
  32. public class Person
  33. {
  34. public Guid Id { get; set; }
  35.  
  36. public string Name { get; set; }
  37.  
  38. public ICollection<WorkItem> Tasks { get; set; }
  39. }
  40.  
  41. public class WorkItem
  42. {
  43. public Guid Id { get; set; }
  44.  
  45. public string Description { get; set; }
  46.  
  47. [ForeignKey("Person")]
  48. public Guid WorkItemCreatorId{ get; set; }
  49.  
  50. public Person Creator { get; set; }
  51.  
  52. }
Add Comment
Please, Sign In to add comment