OData / ODataSamples

Samples: For ODataLib, OData Web API, RESTier, etc.
http://odata.github.io/
Other
296 stars 223 forks source link

OData and DTOs #98

Closed bugproof closed 6 years ago

bugproof commented 6 years ago

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.

The documentation of the library seems outdated.