Last post Aug 26, 2016 05:59 AM by Yohann Lu
Aug 25, 2016 05:46 PM|vs2010junkie|LINK
I have some new requirements for paging, sorting and filtering in my ASP.NET Web API Web application which I had previously designed to use a standard RESTful interface. I am wrapping all of my Entity Framework operations currently using a Repository pattern
along with using a DI container such as Unity to inject the appropriate Repositories.
However, I am thinking that I may have to use ODataControllers to meet the paging, sorting and filtering requirements of my application, however, this implementation seems very tightly coupled to hooking into the Entity Framework Data Model.
Is there a way to use OData with Web API without tightly coupling it to my Entity Framework Data Model and still retain the abstraction to use my Repository classes instead?
Please advise. Any code samples/examples would be greatly appreciated.
Aug 26, 2016 05:59 AM|Yohann Lu|LINK
You can refer the following tutorials. It described Entity Framework Database First to generate database entities and use a generic repository pattern and dependency injection / IoC to access entities through EF.The Repository uses generics and as such is
not tightly-coupled on either end.
Using C#, MVC, WebAPI, OData, Entity Framework, DI/IoC, and Kendo UI MVC and Efficient Data Retrieval: