title: Implementing OData with WebApi and Mapped Models
body: <p>I am trying to implement OData in WebApi.  I am using the repository pattern and EF5 (in the backend) which is still consistent with all the examples I have found.  Here is where thing go wonky.  I am trying to hide the EF generated classes behind models that are being mapped using AutoMapper in the controller.  The examples I have seen seem to return whatever comes out of the repo</p>
  
  <p>I don't want to apply the OData parameters (to the results that have been mapped) in the controller but in the repository to preserve the value from delayed execution.  I can pass the ODataCriteria into the repository, but when I try to Appy, I get an error because it seems the options/results are typed to the IQueryable&lt; Model > from the presentation layer not IQueryable&lt; EF_Class >.</p>
  
  <p>I saw someone else eluded to this in another post, however, it was a minor part of the post and it didn't seem to help.</p>
  
  <p>Has anyone else dealt with this?  I really don't want to expose the EF classes.  Oh, I am using DB first.</p>
  
  <p>Thanks in advance...</p>