title: RIAServices unsupported types on hand-built DomainService
body: <p>My EF model was generated from my SQL Server database. I then generated a DomainService for RIAServices against the EF model. One of the entities is called "EntryCategories". The DomainService created this method:</p>
  
  <pre><code>public IQueryable&lt;EntryCategories&gt; GetEntryCategoriesSet()
  {
      return this.Context.EntryCategoriesSet;
  }
  </code></pre>
  
  <p>Since my user interface display model looks quite different from the physical model, I decided to write my own DomainService for that and related entities. Yes, I know we are meant to modify the generated one but it has so much stuff in there and I wanted to focus on a small thing.</p>
  
  <p>I removed the <em>EnableClientAccess</em> attribute from the generated DomainService and added a new class called ClientDomainService, and encapsulated in it the generated DomainService:</p>
  
  <pre><code>[EnableClientAccess()]
  public class ClientDomainService : DomainService
  {
      // the generated domain service encapsulated in my new one.
      private DataDomainService _dcds = new DataDomainService(); 
  
      // reimplement one of the DataDomainService methods
      public IQueryable&lt;EntryCategories&gt; GetEntryCategories()
      {
          return (from t in _dcds.GetEntryCategoriesSet() where t.EntryCategoriesVersions.EntryCategoriesVersionId == datahead.EntryCategoriesVersions.EntryCategoriesVersionId orderby t.DisplayOrder select t);
      }  
  }
  </code></pre>
  
  <p>The very fist thing I tried is to reimplement the GetCateogoriesSet method but with the underlying data filtered based on another entity in my class (not shown). But when I build this, an error shows up:</p>
  
  <pre><code>Entity 'DataProject.Web.EntryCategories' has a property 'EntryCategoriesVersionsReference' with an unsupported type
  </code></pre>
  
  <p>If I comment out my CientDomainService, replace the <em>EnableClientAccess</em> attribute on the generated DomainService, and place the analagous linq filtering in the original GetEntryCategoriesSet method, the project compiles with no errors.</p>
  
  <p>What is so special about the generated DomainService that my new one doesn't have? Is it that metadata.cs file?</p>