title: Silverlight and RIA Services with LINQ-to-SQL DataContext - Unable to use client side linq queries
body: <p>I have created a bare bones Silverlight application with RIA Services. The domain service class uses a LINQ-to-SQL class as its DataContext. </p>
  
  <p>In my Silverlight application this works fine: </p>
  
  <pre><code>CMSContext db = new CMSContext();
  
  gridTest.ItemsSource = db.Files; 
  db.Load(db.GetFilesQuery());
  </code></pre>
  
  <p>But I'm not able to do this, for example: </p>
  
  <pre><code>db.Load(from f in db.GetFilesQuery() where f.Id &gt; 2 select f);
  </code></pre>
  
  <p>Compiler errors: </p>
  
  <pre><code>Error   5   The type arguments for method 'System.ServiceModel.DomainServices.Client.DomainContext.Load&lt;TEntity&gt;(System.ServiceModel.DomainServices.Client.EntityQuery&lt;TEntity&gt;)' cannot be inferred from the usage. Try specifying the type arguments explicitly.  C:\SilverLight\Silverlight 4 Projects\RIATest2\RIATest2\MainPage.xaml.cs    35  4   RIATest2
  Error   4   Could not find an implementation of the query pattern for source type 'System.ServiceModel.DomainServices.Client.EntityQuery&lt;RIATest2.Web.File&gt;'.  'Where' not found.   C:\SilverLight\Silverlight 4 Projects\RIATest2\RIATest2\MainPage.xaml.cs    35  22  RIATest2
  </code></pre>
  
  <p>Any tips? </p>
  
  <p><strong>Update:</strong></p>
  
  <p>The solution is to add this: </p>
  
  <pre><code>using System.ServiceModel.DomainServices.Client; 
  </code></pre>