c# - ASP.Net MVC4 RC Web-Api Odata filter not working with IQueryable -
in asp.net mvc4 rc's web-api, had action defined before:
public iqueryable<person> get() { var lst = ctx.getlistfromdb(); return lst.asqueryable(); } when was running before if called url like: /api/people?$inlinecount=allpages&$format=json&$top=50&$filter=(state+eq+'al'+and+zip+eq+'35242')
it filtering on objects, has changed since beta break this?
you have put [queryable] attribute on method allow filtering. release notes describing change are here.
update: in rtm seem have separated feature own assembly have include reference asp.net web api odata assembly microsoft. can find latest version on nuget https://nuget.org/packages/microsoft.aspnet.webapi.odata
update: in latest version queryable attribute have been renamed enablequery. more information changes see http://blogs.msdn.com/b/webdev/archive/2014/03/13/getting-started-with-asp-net-web-api-2-2-for-odata-v4-0.aspx
Comments
Post a Comment