Context:
I have an existing Web API of the following form: http://site/api/{area}?slicer1=alpha&slicer1=beta&starttime=sometime&endtime=sometime
It's implemented in ASP MVC. The API's function processes the parameters and feeds them into a SQL query. On success, it returns a IHttpActionResult with JSON data from SQL.
Note that the API lacks an entity model or entity relationship diagram. It's essentially just a wrapper around a SQL query.
Question:
Recently, I started learning about OData. It seems like OData is designed for the URL itself to control how data is filtered, as opposed to authoring a custom SQL query to filter.
Hence, I'd like an answer on whether my Web API could be converted to an OData API and, if so, what OData capabilities I'd need to do that (for instance, might OData v4 functions be useful)?
Clarifications:
- I don't have any code written, nor am I asking for code as an answer.
- I am looking to know what OData capabilities might enable my scenario (v4 functions, actions, etc...), or if OData and Web APIs are so different that my ask doesn't make sense.
- Anticipating the "Why are you asking" this questions - I'm just interested in technically feasibility as a learning exercise.