title: Enumerate OData Service Data Context
body: <p>I have a OData service that returns a list of sharepoint lists.
  I am unable to enumerate this list.</p>
  
  <p>Is it possible to enumerate this to be able to loop through the lists in this Context in a foreach loop? </p>
  
  <pre><code>public class ODService
  {
      private DataContext _Context;
      private NetworkCredential _nc;
  
      public DataContext Context { get { return _Context; } }
  
      /// &lt;summary&gt;
      /// Constructor creates the context for access to sharepoint
      /// &lt;/summary&gt;
      /// &lt;param name="UserName"&gt;Service Account User Name&lt;/param&gt;
      /// &lt;param name="Password"&gt;Service Account Password&lt;/param&gt;
      /// &lt;param name="uri"&gt;Service uri&lt;/param&gt;
      public ODService(string UserName, string Password, string uri)
      {
          SetNetworkCredentials(UserName, Password);
          SetContext(uri);
      }
  
      private void SetContext(string uri)
      {
          _Context = new DataContext(new Uri(uri));
          _Context.Credentials = _nc;
          _Context.MergeOption = MergeOption.NoTracking;
  
      }
  
      private void SetNetworkCredentials(string UserName, string Password)
      {
          _nc = new NetworkCredential(UserName, Password);
      }
  }
  </code></pre>