title: Instantiating list of an object
body: <p>I'm sure this question has been answered before, but I'm honestly not sure how to find the answer, and my searching hasn't yielded any results; feel free to answer this question by closing the topic and pointing me to the correct question / answer.</p>
  
  <p>Let's say I have a class representing a Member of my organization. The class has a constructor to instantiate the Member object, taking as a parameter the Member ID, and executing a database call to return the row representing the Member, along with whatever properties of the Member I'm interested in using.</p>
  
  <p>What is the correct protocol for obtaining a list of members?</p>
  
  <p>My database query is simple - I have a stored procedure which will return me the list of members that I'm interested in obtaining. But how do I represent that on the application level?</p>
  
  <p>Right now, I have a constructor for the Member object that takes as an input a DataRow, and assigns all the relevant properties of the Member object. I'm then doing the following:</p>
  
  <pre><code>public static List&lt;member&gt; getList()
  {
      DataTable dt = GetMemberList();
      List&lt;member&gt; memberList = new List&lt;member&gt;()
      foreach (DataRow dr in dt.Rows) memberList.Add(new member(dr));
      return memberList;
  }
  </code></pre>