Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating Odata Web API application without Entity Framework

I am looking for a sample Odata application by using WebApi, but without using EF. My requirement is to implement a couple of action methods inside a controller (derived from ODataController) that return complex objects that can be queried. These action methods should also be able to take multiple parameters. The data returned is being pulled from multiple data sources, so using entity framework is not an option. I would like to implement a method like this:

public List RetrieveCustomersByFilter(string name, string lastName, CustomerTypeEnum) { ...business logic goes here ... }

I have done a lot of research online, but I am still not able to find a concrete example. Most of them show simple methods that don't accept any parameters (or an id/key) and return a List of standard objects.

Can anyone provide a sample or point me to a link that shows how to go about this?

Thanks

like image 779
AgentHunt Avatar asked Jun 04 '26 00:06

AgentHunt


1 Answers

check this out has the latest Web API 2 with ODATA sample with all steps ODATA v4 sample with asp.net web api 2

like image 197
Sundara Prabu Avatar answered Jun 05 '26 12:06

Sundara Prabu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!