![]() ![]() Open up the ValuesController.cs file that was created for us when we started the project. Linq to Querystring can work with any type of data source or format, so long as your API method can return an IQueryable. Setting up the APIįirst we need to write some code in our API so that we can retrieve some values. If all goes well, you should see something like this:Īlso make sure to add the WebAPI extension to make things even easier to use: PM> install-package LinqToQuerystring.WebApi To do that, open the package manager console (View->Other Windows->Package Manager Console if it’s not open already), and type the following: install-package LinqToQuerystring Once everything loads up, we just need to install LinqToQuerystring before we can get started. Leave the rest of the settings as default, and click OK again to create the project. Then on the next screen, select the Web API template: Getting set upįire up Visual Studio and start a new ASP.Net MVC 4 project:Ĭhoose a suitable name and click OK. In this post I’ll take you through creating a sample table with paged data using Web API\Linq to Querystring from start to finish. So lets have a look now at some of the practical applications for Linq to Querystring (and for OData in general) from a beginners perspective. Thanks to everyone who’s provided feedback so far! It’s been a little while now since I released Linq to Querystring into the wild… we’ve since solved a few issues and it’s been put to use in some real-world applications.
0 Comments
Leave a Reply. |