1

We have an existing REST API built with ASP.NET Core (2.1), EntityFramework Core (2.1) with tens of Controllers that basically provides CRUD on tens of SQL tables. Very simple yet.

Each Controller has a method that fetch data from SQL table (through DbContext), retrieved models are mapped into 'DTO' and returned as ActionResult.

We receive lot of feedback to implement simple way to query API, like the OData way.

Is it possible to integrate OData to existing controllers, respecting existing routes, on existing DbContext?

Ideally, I would do some configuration and then just add [Queryable] on method to which I want to provide OData query.

Every example I have found contains such code:

routes.MapODataServiceRoute("odata", "odata", builder.GetEdmModel());

Luke1988
  • 1,850
  • 2
  • 24
  • 42
  • Related stackoverflow post: [OData Support in ASP.net core (2016)](https://stackoverflow.com/questions/39279552/odata-support-in-asp-net-core) – RAM Nov 20 '18 at 09:44

0 Answers0