Let's say the number of answers of multiple choice questions varies. One question can have only 2 choices while another can have 10 choices.

How can I save these multiple choice questions in my MSSQL database? Is the following model viable?

public class MultipleChoiceQuestion
    public Guid Id { get; set; }

    public string Question { get; set; }

    // Suppose I can have 2-10 answers
    public List<string> Answers { get; set; }


  • Can we store a list of objects with various length in MSSQL database with code-first migration enabled in ASP.NET?
  • If it is not applicable, what is the best solution to deal with such problems?

Related posts

Recent Viewed