I have found many way to user Entity Framework but All I am looking to do is to use standard Connection to pull data from a database and then expose it through web API.
I can grab every record through the main IEnumerable but I don't want to have to grab 15,000 records from a table where I only need one.
If anyone can point me in the right direction here I would be very thankful.
Dont forget to click mark as answer when you post gets answered.
mystrymaster
Member
433 Points
144 Posts
Web API plus a regular Database Connection
Jan 22, 2013 07:05 PM|LINK
I have found many way to user Entity Framework but All I am looking to do is to use standard Connection to pull data from a database and then expose it through web API.
I can grab every record through the main IEnumerable but I don't want to have to grab 15,000 records from a table where I only need one.
If anyone can point me in the right direction here I would be very thankful.
DarrellNorto...
All-Star
87453 Points
9718 Posts
Moderator
MVP
Re: Web API plus a regular Database Connection
Jan 23, 2013 09:38 AM|LINK
Sounds like you could use OData. MVC4 and WebAPI support OData and it's pretty easy.
See this blog post to get started:
http://robbincremers.me/2012/02/16/building-and-consuming-rest-services-with-asp-net-web-api-and-odata-support/
Darrell Norton's Blog
Please click "Mark as Answer" if this helped you.