У меня есть модель представления, содержащая список разделов, как показано ниже.Мне нужно создать список ResponseEntryViewModel и добавить разделы и подразделы внутри разделов и вопросы внутри подразделов.
Есть предложения?
public class ResponseEntryViewModel
{
public int TypeID { get; set; }
public string TypeName { get; set; }
public int User_ID { get; set; }
public List<SectionDataModel> Sections{ get; set; }
public ResponseEntryViewModel()
{
Sections = new List<SectionDataModel>();
}
public class SectionDataModel
{
public int SectionID { get; set; }
public string Name { get; set; }
public string Status { get; set; }
public int TypeId { get; set; }
public List<SubSectionModel> SubSections { get; set; }
public SectionDataModel()
{
SubSections = new List<SubSectionModel>();
}
}
public class SubSectionModel
{
public int SubSectionID { get; set; }
public string Name { get; set; }
public string Status { get; set; }
public int SectionId { get; set; }
public List<QuestionModel> QuestionsList { get; set; }
public SubSectionModel()
{
QuestionsList = new List<QuestionModel>();
}
}
public class QuestionModel
{
public int SubSectionID { get; set; }
public int QuestionID { get; set; }
public string Question { get; set; }
}
}