I saw a lot of confusion about this on many forums.
How should I properly use OData with DTOs? Let's say we have Product and ProductDTO. Should I use ProductDTO with EntitySet like this?:
var builder = new ODataConventionModelBuilder();
builder.EntitySet<ProductDTO>("Products");
Also, is it required to return IQueryable from my controllers when using OData? I have my data access code encapsulated in my service layer and nobody except my service layer can query the database directly.
I saw a lot of confusion about this on many forums.
How should I properly use OData with DTOs? Let's say we have
Product
andProductDTO
. Should I useProductDTO
withEntitySet
like this?:Also, is it required to return IQueryable from my controllers when using OData? I have my data access code encapsulated in my service layer and nobody except my service layer can query the database directly.
The documentation of the library seems outdated.