title: DbSet vs. ObjectSet - string predicate
body: <p>Is there anyway to create an <code>ObjectSet</code> from a <code>DbSet</code>?</p>
  
  <p>Some background information:  I have a model (EF 4.2) that is returning DbSets within the object context.  I need to retrofit it to support an API from an older data model (EF4).  The older data model was returning object sets, and several methods within the API (an IIS hosted WCF 3.5 Service) accept query string predicates that were passed to the older model.  I need to replicate this behavior in the new model, however, the <code>DbSet.Where</code> method does not accept a string predicate parameter.  I was able to get it to work partially by creating an object set from the Object Context (<code>ObjectContext.CreateObjectSet&lt;T&gt;(string)</code>) however doing it this way I can't seem to get any include statements to work correctly.  </p>
  
  <p>Is there a way to either pass string predicates into a <code>DbSet</code>, or is there a way to get an <code>ObjectSet</code> from a <code>DbSet</code> in which the <code>.Include</code> method loads the related data sets?</p>
  
  <p>Thanks in advnce (some code snippets below):</p>
  
  <p>Class to create <code>ObjectSet</code> (so I initialize with my context and instead of using the DbSet returned for these in <code>ClinicalContext.Exams</code> etc, I get the underlying Object Context and create an <code>EntitySet</code> from that using the same objects that would be contained in the <code>DbSet</code>.</p>
  
  <pre><code>public class ExamServicesEntities
  {
      private ClinicalContext _Context;
      public ExamServicesEntities(ClinicalContext context)
      {
          _Context = context;
      }
  
      private ObjectSet&lt;Exam&gt; _ExamEntities;
      public ObjectSet&lt;Exam&gt; Exams
      {
          get
          {
              if (_ExamEntities == null)
              {
                  _ExamEntities = _Context.ObjectContext.CreateObjectSet&lt;Exam&gt;("Exams");
              }
              return _ExamEntities;
          }
      }
  
      private ObjectSet&lt;Visit&gt; _VisitEntities;
      public ObjectSet&lt;Visit&gt; Visits
      {
          get
          {
              if (_VisitEntities == null)
              {
                  _VisitEntities = _Context.ObjectContext.CreateObjectSet&lt;Visit&gt;("Visits");
              }
              return _VisitEntities;
          }
      }
  </code></pre>
  
  <p>}</p>
  
  <p>Doing this loads the data correctly but when I attempt to Include one of the other objects (Exam contains a Visit, Visit contains a Patient) the references are not built.</p>