Our application architecture contains the following layers:
- Presentation Layer
- Service Layer
- Business Layer
- Data Layer
The Service layer uses WebAPI to expose RESTful services. When retrieving data we would like to standardize on some syntax for paging. OData seems like a great place to start. The service layer utilizes the business layer to retrieve data.
The business layer, in turn utilizes the data layer which is built on the Entity Framework. The data layer passes a list of entity objects back to the business layer. The business layer then converts the list of entity objects to a list of
DTOs for public consumption.
Adding OData to our service appears to manipulate the IQueryable set of DTOs with one major performance issue. The OData operations are performed on the list of DTOs. If we pass in something like the following:
The data layer retrieves all 100,000 codes, passes them to the business layer which in turn converts them to a list of DTOs. OData then applies the "paging". It works, but it's slow.
It would be nice if there was a way to pass the ODataQueryOptions down to the data layer so the database would filter the list. Is this something in the works? I believe our system design implements many of Microsoft's best practices for system
architecture. This must be an issue for other developers out there?
I have installed Web API OData 0.3.0-rc.