Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public override void Up()
- {
- AddColumn("dbo.StandingDatas", "Person_Id", c => c.Int());
- CreateIndex("dbo.StandingDatas", "Person_Id");
- AddForeignKey("dbo.StandingDatas", "Person_Id", "dbo.People", "Id");
- }
- public override void Up()
- {
- AddColumn("dbo.People", "Therapies_Id", c => c.Int(nullable: false));
- CreateIndex("dbo.People", "Therapies_Id");
- AddForeignKey("dbo.People", "Therapies_Id", "dbo.StandingDatas", "Id", cascadeDelete: true);
- }
- public class User
- {
- [Key,ForeignKey("Profile")]
- public int Id { get; set; }
- public Profile Profile { get; set; }
- }
- public class Profile
- {
- [Key]
- public int Id { get; set; }
- public virtual User ProfileOwner { get; set; }
- public virtual ICollection<StandingData> DataCollection { get; set; }
- }
- public class StandingData
- {
- [Key]
- public int Id { get; set; }
- public int ProfileId { get; set; }
- [ForeignKey("ProfileId")]
- public virtual Profile Profile { get; set; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement