title: Return objects with populated list properties from stored procedure
body: <p>I'm new to SQL Server stored procedures, so apologies if I'm being an idiot. I would like to use a stored procedure to return a list of objects, each of which has a property containing a list of related objects. For example</p>
  
  <pre><code>public class Question
  {
      public int QuestionID { get; set; }
      public string Question { get; set; }
      public List&lt;Answer&gt; Answers { get; set; }
  }
  
  public class Answer
  {
      public int AnswerID { get; set;}
      public int QuestionID { get; set; }
      public string Answer { get; set;}
  }
  </code></pre>
  
  <p>I would like to write a stored procedure that returns a list of Questions, each of which has its Answers property populated with the related Answer objects.</p>
  
  <p>Any help greatly appreciated!</p>
  
  <p>Thanks,</p>
  
  <p>Dave</p>