Tuesday, January 15, 2019

Set references to primary keys in other tables at a POCO in Entity Framework 6's code first approach to thing.

public class ProgramSurvey
{
   [Key, Column(Order = 1)]
   public int ProgramId { get; set; }
   public virtual Program Program { get; set; }
   
   [Key, Column(Order = 2)]
   public int SurveyTypeId { get; set; }
   public virtual SurveyType SurveyType { get; set; }
   
   [Key, Column(Order = 3)]
   public int QuestionId { get; set; }
   public virtual Question Question { get; set; }

No comments:

Post a Comment