title: LINQ: Passing lambda expression as parameter to be executed and returned by method
body: <p>So here is the scenario: i have a series of different repository classes that each can use an isolated data context, or a shared context. In the cases where an isolated context is being used i want to add a method to the base class that will allow me to specify the lambda as the parameter, have that expression be executed by the isolated context of the chosen repository and return an IQueryable result. How would the method signature look, and how to a pass the expression to the context?</p>
  
  <p>I need the solution to be as generic as possible as any possible model object/table could be used.</p>
  
  <p>Here is basically what i am looking to do:</p>
  
  <pre><code>IAssetRepository repo = new AssetRepository(true); // true indicates isolated context
  var results = repo.ExecuteInContext&lt;SomeType&gt;(SomeTable.Where(x =&gt; 
                                                x.SomeProp.Equals(SomeValue)));
  </code></pre>