Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. public override void Up()
  2. {
  3. AddColumn("dbo.StandingDatas", "Person_Id", c => c.Int());
  4. CreateIndex("dbo.StandingDatas", "Person_Id");
  5. AddForeignKey("dbo.StandingDatas", "Person_Id", "dbo.People", "Id");
  6. }
  7.  
  8. public override void Up()
  9. {
  10. AddColumn("dbo.People", "Therapies_Id", c => c.Int(nullable: false));
  11. CreateIndex("dbo.People", "Therapies_Id");
  12. AddForeignKey("dbo.People", "Therapies_Id", "dbo.StandingDatas", "Id", cascadeDelete: true);
  13. }
  14.  
  15. public class User
  16. {
  17. [Key,ForeignKey("Profile")]
  18. public int Id { get; set; }
  19. public Profile Profile { get; set; }
  20. }
  21.  
  22. public class Profile
  23. {
  24. [Key]
  25. public int Id { get; set; }
  26. public virtual User ProfileOwner { get; set; }
  27. public virtual ICollection<StandingData> DataCollection { get; set; }
  28. }
  29.  
  30. public class StandingData
  31. {
  32. [Key]
  33. public int Id { get; set; }
  34.  
  35. public int ProfileId { get; set; }
  36.  
  37. [ForeignKey("ProfileId")]
  38. public virtual Profile Profile { get; set; }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement