IWebQueryable and DefaultWebQueryRepository
IWebQueryable interface defines a repository which accepts an ODATA query as inputs
and returns paged results:
IWebQueryProvider object contains the ODATA query. It is available through dependency
injection when the ODATA middleware is added.
D is the data ViewModel whose properties
are used in the ODATA query, and
Dext a subclass of it with further properties that contains grouped values,
that is returned in the paged results when the ODATA query contains groupings.
DefaultWebQueryRepository is the default implementation of
It acts as a wrapper that adds the
ExecuteQuery method to any existing
ICRUDRepository to be wrapped is passed as the unique parameter of the
constructor. Below an example that shows how to use
In case the query contains no sorting a default sorting must be added otherwise data cannot be paged
and the call to the
ExecuteQuery method results into an
The same argument applies to
queryProvider.Top that defines the page size.
Both instructions must preceed any other usage of