title: Collections returning
body: <p>I am having difficulty getting two records out of a function when using 
  collection.  I don't know what I am doing wrong, thank you in advance for any 
  help.</p>
  
  <p>Service calling function...</p>
  
  <pre><code>Announcements announcements = new Announcements(ID, moduleID, _config, _logger);
  
  return announcements;  // this does not contain anything although Announcements load functions has two record
  </code></pre>
  
  <pre><code>namespace Api.Collection
  {
      public class Announcements : List&lt;Announcement&gt;
      {
          IConfiguration _config;
          ILoggerManager _logger;
  
          private string _uspGetAnnouncement = "storedproced_GetAnnouncemnt";
  
          public List&lt;Announcement&gt; announcements = new List&lt;Announcement&gt;();
          public Announcements()
          {
  
          }
          public Announcements(int employeeID, int moduleID, IConfiguration config, ILoggerManager logger)
          {
              _config = config;
              _logger = logger;
  
              if (employeeID &gt; 0 &amp;&amp; moduleID &gt; 0)
              {
                  Load(employeeID, moduleID);
              }
          }
  
          public virtual void Load(int employeeID, int moduleID)
          {     
              List&lt;SqlParameter&gt; lParam = new List&lt;SqlParameter&gt;();
  
              Util.DataUtil dataUtil = new Util.DataUtil(_config);
              SqlParameter param;
  
              if (employeeID &gt; 0 &amp;&amp; moduleID &gt; 0)
              {
                  param = new SqlParameter("@employeeID", employeeID);
                  lParam.Add(param);
  
                  param = new SqlParameter("@moduleID", moduleID);
                  lParam.Add(param);
              }
  
              DataTable dt = Util.GetDataTable(_uspGetAnnouncement, lParam.ToArray());
  
              if (dt.Rows.Count &gt; 0)
              {
                  foreach (DataRow dr in dt.Rows)
                  {
                      announcements.Add(new Announcement(dr, dt.Rows.Count, _config, _logger));
                  }
              }
              return announcements;   *** this has 2 records
          }
      }
  }
  </code></pre>