<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Supporting OData Query Options</title><link>http://www.asp.net</link><pubDate>Sat, 20 Apr 2013 06:28:30 GMT</pubDate><generator>umbraco</generator><description>Comments for Supporting OData Query Options</description><language>en</language><atom:link href="http://www.asp.net/rss/comments/43779" rel="self" type="application/rss+xml" /><item><title>Comment Posted by FabioVC</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-query-options</link><pubDate>Tue, 26 Feb 2013 15:09:19 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018524</guid><description><![CDATA[ <p>Mike,</p><p></p><p>Thank you for the information. With this new capabilities, is there a matrix that shows how the Web API support for OData compares to the WCF Data Services OData support? Is the recommendation now to favor WEB API for OData over WCF Data Services?</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/FabioVC.jpg?forceidenticon=false&amp;dt=635049946800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by byunru</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-query-options</link><pubDate>Wed, 27 Feb 2013 13:05:37 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018535</guid><description><![CDATA[ <p>with this new version, how to support other format like cvs,...  this approach provided by this link won&#39;t work anymore:  <a rel="nofollow" href="http://www.tugberkugurlu.com/archive/creating-custom-csvmediatypeformatter-in-asp-net-web-api-for-comma-separated-values-csv-format" target="_blank">www.tugberkugurlu.com/</a></p><p>&lt;ExceptionMessage&gt;</p><p>Query option &#39;Format&#39; is not allowed. To allow it, set the &#39;AllowedQueryOptions&#39; property on QueryableAttribute or QueryValidationSettings.</p><p>&lt;/ExceptionMessage&gt;</p><p>Can you give advice how to extend MediaTypeFormatter ?  Thanks.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/byunru.jpg?forceidenticon=false&amp;dt=635049946800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by russgove</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-query-options</link><pubDate>Mon, 04 Mar 2013 13:49:11 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018570</guid><description><![CDATA[ <p>I installed  ASP.NET and Web Tools 2012.2 Update and added the code config.EnableQuerySupport();  to ny WebApiConfig,. I&#39;m getting an error    </p><p>&#39;System.Web.Http.HttpConfiguration&#39; does not contain a definition for &#39;EnableQuerySupport&#39; and no extension method &#39;EnableQuerySupport&#39; accepting a first argument of type &#39;System.Web.Http.HttpConfiguration&#39; could be found.</p><p></p><p>Is there somthing more I need to do?</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/russgove.jpg?forceidenticon=false&amp;dt=635049946800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by wtfsven</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-query-options</link><pubDate>Tue, 05 Mar 2013 14:00:15 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018578</guid><description><![CDATA[ <p>I&#39;m having the same problem as russgove.  I&#39;ve installed the update, downloaded and installed the nuget package, and yet still no EnableQuerySupport()  It&#39;s not even in my Object Browser.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/wtfsven.jpg?forceidenticon=false&amp;dt=635049946800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by MikeWasson</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-query-options</link><pubDate>Tue, 05 Mar 2013 14:36:07 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018579</guid><description><![CDATA[ <p>russgove, wtfsven: EnableQuerySupport is defined in System.Web.Http.ODataHttpConfigurationExtensions. </p><p></p><p>If you installed 2012.2 Update and create a new Web API project, the OData package is automatically added to the project.</p><p></p><p>If you use another project template (like the &quot;Basic&quot; MVC template) or upgrade an existing project, you need to add the Microsoft.AspNet.WebApi.OData NuGet package to your project. </p><p></p><p>The tutorial doesn&#39;t make this very clear ... I&#39;ll update the tutorial.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/MikeWasson.jpg?forceidenticon=false&amp;dt=635049946800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by MikeWasson</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-query-options</link><pubDate>Tue, 05 Mar 2013 15:15:48 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018580</guid><description><![CDATA[ <p>byunru: For the query string, are you using &quot;?format=csv&quot; or &quot;?$format=csv&quot;? </p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/MikeWasson.jpg?forceidenticon=false&amp;dt=635049946800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by haggren</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-query-options</link><pubDate>Wed, 06 Mar 2013 07:19:43 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018586</guid><description><![CDATA[ <p>Hi Mike</p><p></p><p>Great post :)</p><p></p><p>I&#39;m trying to get $inlinecount=allpages to work but count is not added to the result.</p><p>Any special thing a need to setup?</p><p></p><p>Thanks :)</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/haggren.jpg?forceidenticon=false&amp;dt=635049946800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by wichmo</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-query-options</link><pubDate>Wed, 06 Mar 2013 17:04:39 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018594</guid><description><![CDATA[ <p>I have the same issue as haggren.</p><p></p><p>I don&#39;t get any of this information to be returned:</p><p></p><p>  &quot;odata.metadata&quot;:&quot;http://localhost/$metadata#Products&quot;,</p><p>  &quot;odata.count&quot;:&quot;50&quot;,</p><p>  &quot;value&quot;:[</p><p></p><p>I just get the content of value returned.</p><p></p><p>Is there something else we need to set up to get this other piece of information?</p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/wichmo.jpg?forceidenticon=false&amp;dt=635049946800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by stevo.zilik</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-query-options</link><pubDate>Wed, 06 Mar 2013 20:12:12 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018596</guid><description><![CDATA[ <p>Hi great work. </p><p></p><p>I was wondering whether is it possible to configure some of the output field names, specifically I&#39;m after renaming &quot;odata.count&quot; to something without a dot &quot;.&quot;, since it causes trouble to my JS odata client. </p><p></p><p>Thanks</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/stevo.zilik.jpg?forceidenticon=false&amp;dt=635049946800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by anthonyjohnston</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-query-options</link><pubDate>Fri, 08 Mar 2013 04:29:27 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018620</guid><description><![CDATA[ <p>This is excellent stuff, thank you</p><p></p><p>Will it be supporting Async too?</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/anthonyjohnston.jpg?forceidenticon=false&amp;dt=635049946800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by devildog74</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-query-options</link><pubDate>Sun, 10 Mar 2013 04:45:03 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018640</guid><description><![CDATA[ <p>The comment on server side paging and PageSize is VERY misleading.  SQL Profiler reveals that if the client does NOT specify $top, that the query sent to SQL Server returns ALL records from SQL Server to the controller - then the controller takes the number of records specified by page size and returns those records in the response.  So 1 million records would be read from the db and sent to the controller, and the controller would return 10 records - that was my finding - maybe this is a bug?</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/devildog74.jpg?forceidenticon=false&amp;dt=635049946800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by stevo.zilik</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-query-options</link><pubDate>Mon, 11 Mar 2013 21:27:01 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018659</guid><description><![CDATA[ <p>using OData + EF, I&#39;m struggling to support calculated properties that are not part of the db query (but I&#39;ve defined them on the model) and I&#39;m calculating the values on server (even hardcoding it doesn&#39;t work). The property either gets completely ignored (left out from the result) or EF is complaining that it does not recognize it (even though it&#39;s not in the EF query itself, the odata engine must be including it)</p><p></p><p><a rel="nofollow" href="http://forums.asp.net/p/1887669/5328429.aspx/1?p=True&amp;t=634986325526731960" target="_blank">forums.asp.net/</a></p><p></p><p></p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/stevo.zilik.jpg?forceidenticon=false&amp;dt=635049946800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by MikeWasson</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-query-options</link><pubDate>Thu, 14 Mar 2013 18:27:11 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018700</guid><description><![CDATA[ <p>@devildog74: Yes, you&#39;re correct. PageSize is designed to limit the response size, not the query, I&#39;ll clarify this in the doc. btw, this is fixed for vNext: <a rel="nofollow" href="http://aspnetwebstack.codeplex.com/workitem/901" target="_blank">aspnetwebstack.codeplex.com/</a></p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/MikeWasson.jpg?forceidenticon=false&amp;dt=635049946800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by bryannet</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-query-options</link><pubDate>Fri, 15 Mar 2013 12:14:50 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018706</guid><description><![CDATA[ <p>Regarding inlinecount, I am having the same problems as  haggren,  and wichmo. </p><p></p><p>I have enabled config.EnableQuerySupport(); </p><p></p><p>I have added [Queryable] to the my get method - </p><p></p><p>[Queryable]</p><p>public IQueryable&lt;string&gt; Get()</p><p></p><p>Sorting and filtering are working fine, only inlinecount does not work. I have tried both json and xml as return types. </p><p></p><p>Is there something else I need to add? Let me know if you want me to send you my source code. </p><p></p><p>Thanks</p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/bryannet.jpg?forceidenticon=false&amp;dt=635049946800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by MikeWasson</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-query-options</link><pubDate>Fri, 15 Mar 2013 13:55:55 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018708</guid><description><![CDATA[ <p>@bryannet and others: Sorry, this was my mistake. Turns out that $inlinecount is only supported for OData formats. The basic reason is that $inlinecount changes the &quot;shape&quot; of the data that is returned, so it doesn&#39;t work with the default XML and JSON formatters. See this answer on SO: <a rel="nofollow" href="http://stackoverflow.com/a/15422935/1261807" target="_blank">stackoverflow.com/</a></p><p></p><p>I&#39;ll correct the docs.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/MikeWasson.jpg?forceidenticon=false&amp;dt=635049946800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by gmellon</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-query-options</link><pubDate>Wed, 03 Apr 2013 12:34:30 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018844</guid><description><![CDATA[ <p>In case of a global rule e.g.</p><p>           // set defaults for query options</p><p>            var queryAttribute = new QueryableAttribute</p><p>                {</p><p>                    PageSize = DefaultPageSize,</p><p>                    AllowedQueryOptions = AllowedQueryOptions.All</p><p>                };</p><p>            config.EnableQuerySupport(queryAttribute);</p><p>You should mention that [Queryable] attribute in Get method(s) needs to be removed in order for the global rule to apply.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/gmellon.jpg?forceidenticon=false&amp;dt=635049946800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Andrea Maruccia</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-query-options</link><pubDate>Sat, 20 Apr 2013 06:28:30 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018943</guid><description><![CDATA[ <p>Hi there, any idea when the $count operator will be supported? Thanks, Andrea</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/Andrea%20Maruccia.jpg?forceidenticon=false&amp;dt=635049946800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>