ASP.NET MVC4 Beta introduced an easy way to create OData endpoints using WebAPI.
So having the following controller:
public class ValuesController : ApiController
{
// GET /api/values
public IQueryable<Document> Get()
{
return (new[] {
new Document() { Info = "a", Title = "qwe1" },
new Document() { Info = "b", Title = "qwe2" }, }).AsQueryable();
}
}
I can query the data with url's like: http://localhost:44087/api/values?$filter=Title eq 'qwe1'
Is there a proper .net library that can consume this? So I could do something like:
new WebApiClient("http://localhost:44087/api/values")
.Get<Document>().Where(x=>x.Title == "qwe1").ToList()
Without specifying the $filter=Title eq 'qwe1'
part manually?