title: Class that contains a list of objects
body: <p>I have this class to hold the properties of my data returned from my database call</p>
  
  <pre><code>public class Equipment
  {
      public string EquipmentId { get; set; }
      public string Description { get; set; }
      public string Model { get; set; }
  
      public Equipment()
      {
          // Default Constructor
      }
  
      public Equipment(string equipmentId, string description, string model)
      {
          EquipmentId = equipmentId;
          Description = description;
          Model = model;
      }
  }
  </code></pre>
  
  <p>Then I have another class that acts as a list of Equipment objects.  My service populates this List without issue but when I try to assign values to my  with a foreach loop I am getting an error: Type &lt;> is not enumerable.</p>
  
  <pre><code>public class EquipmentNeedingService : IListSource
  {
      public readonly List&lt;Equipment&gt; _equipmentNeedingService = new List&lt;Equipment&gt;();
  
      public void AddEquipmentToList(Equipment equipment)
      {
          _equipmentNeedingService.Add(equipment);
      }
  
      System.Collections.IList IListSource.GetList()
      {
          return _equipmentNeedingService;
      }
  
      public bool ContainsListCollection
      {
          get { return false; }
      }
  }
  </code></pre>
  
  <p>Everything works fine with this approach through my application but in this specific scenario I am trying to use a foreach loop.  I have read through a few examples but I am not finding exactly what I need and maybe there is a more efficient way to do this?</p>
  
  <p>UPDATE</p>
  
  <p>In the class where I am trying to use this I have a static object that holds the multiple items returned from my database call.</p>
  
  <pre><code>private static EquipmentNeedingService _equipmentNeedingService = null;
  </code></pre>
  
  <p>I try to use this in the OnItemDataBound event of my repeater...</p>
  
  <pre><code>foreach (var item in _equipmentNeedingService)
  {
     // implementation here
  }
  </code></pre>
  
  <p>The error I get is from the _equipmentNeedingService in the foreach loop.</p>