Hjälp med asp.net MVC Model Properties arv
Hej. Jag behöver hjälp med min MVC Appikation och vill rikta er uppmärksamhet till detta inlägg:
http://stackoverflow.com/questions/26279640/mvc-5-model-set-p...
Jag vill alltså via att min IntroResponse skall visa "Survey Question" i sin vy.
Jag vill gärna lösa detta enligt någon Entity Framework best practice och ärva properties från den andra klassen.
public class Survey
{
//THIS CLASS CREATES A SURVEY
public int SurveyID { get; set; }
public string SurveyName { get; set; }
//QUESTION STRINGS. CONTAINS A QUESTION IN TEXT.
public string Question1 { get; set; }
public string Question2 { get; set; }
public string Question3 { get; set; }
public string Question4 { get; set; }
public string Question5 { get; set; }
}
public class IntroResponse : IValidatableObject
{
//THIS CLASS CONTAINS THE INTRO SURVEY RESPONSE
public int IntroResponseID { get; set; }
//SUVERYID
public int SurveyID { get; set; }
[ForeignKey("SurveyID")]
public virtual Survey Survey { get; set; }
public virtual Survey Question1 { get; set; }
public virtual Survey Question2 { get; set; }
public virtual Survey Question3 { get; set; }
public virtual Survey Question4 { get; set; }
public virtual Survey Question5 { get; set; }
}