<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>Paging and Querying</title><link>http://www.asp.net</link><pubDate>Tue, 20 Nov 2012 12:03:50 GMT</pubDate><generator>umbraco</generator><description>Comments for Paging and Querying</description><language>en</language><atom:link href="http://www.asp.net/rss/comments/43065" rel="self" type="application/rss+xml" /><item><title>Comment Posted by venkatmca008</title><link>http://www.asp.net/web-api/videos/getting-started/paging-and-querying</link><pubDate>Sun, 19 Feb 2012 00:04:20 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014876</guid><description><![CDATA[ <p>hi....could u post ur code....it will help us...</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/venkatmca008.jpg?forceidenticon=false&amp;dt=635047936200000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by tfsjohan</title><link>http://www.asp.net/web-api/videos/getting-started/paging-and-querying</link><pubDate>Sun, 19 Feb 2012 04:45:10 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014879</guid><description><![CDATA[ <p>Hi,</p><p></p><p>this sounds great, but I have a question. How do you handle the fact that you almost never return domain objects to the API? You almosmt always have some sort of viewmodel object that contains just the public data.</p><p></p><p>Can I have some extension method that does something like .Select(x =&gt; MapToViewModel(x)) that I call before returning the AsQueryable() that will be run before returning data to the client?</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/tfsjohan.jpg?forceidenticon=false&amp;dt=635047936200000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by jon galloway</title><link>http://www.asp.net/web-api/videos/getting-started/paging-and-querying</link><pubDate>Wed, 07 Mar 2012 18:15:36 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015057</guid><description><![CDATA[ <p>@venkatmca008 I&#39;ve updated the download links to include the code download as well.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/jon%20galloway.jpg?forceidenticon=false&amp;dt=635047936200000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by jon galloway</title><link>http://www.asp.net/web-api/videos/getting-started/paging-and-querying</link><pubDate>Wed, 07 Mar 2012 18:18:33 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015058</guid><description><![CDATA[ <p>@tfsjohan Sure, you can use any data source that supports AsQueryable - even a dictionary would work for that.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/jon%20galloway.jpg?forceidenticon=false&amp;dt=635047936200000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by erikkl2000</title><link>http://www.asp.net/web-api/videos/getting-started/paging-and-querying</link><pubDate>Tue, 13 Mar 2012 11:37:06 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015108</guid><description><![CDATA[ <p>Is view model on the client a div tag or something? I am following you fine but where are you stuffing at?</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/erikkl2000.jpg?forceidenticon=false&amp;dt=635047936200000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by cbordeman</title><link>http://www.asp.net/web-api/videos/getting-started/paging-and-querying</link><pubDate>Mon, 14 May 2012 23:42:55 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015509</guid><description><![CDATA[ <p>Love the automatic OData style paging support!</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/cbordeman.jpg?forceidenticon=false&amp;dt=635047936200000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by dreniers</title><link>http://www.asp.net/web-api/videos/getting-started/paging-and-querying</link><pubDate>Thu, 07 Jun 2012 11:01:53 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015718</guid><description><![CDATA[ <p>You need to decorate with [Queryable] attribute for odata to work in ASP.NET RC.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/dreniers.jpg?forceidenticon=false&amp;dt=635047936200000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by michel.fornaris</title><link>http://www.asp.net/web-api/videos/getting-started/paging-and-querying</link><pubDate>Wed, 01 Aug 2012 20:14:15 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016094</guid><description><![CDATA[ <p>Jon, I have been playing with WebAPI for some time and I can tell that I kind of like it but I think I have found something that will make me think twice before using: generated SQL query when using oData for a IQueryable&lt;T&gt; method from a DbSet&lt;T&gt; is not parametrized.</p><p></p><p>In other words, if you have</p><p>        [Queryable]</p><p>        public IQueryable&lt;Physician&gt; Get()</p><p>        {</p><p>            if (_entities == null)</p><p>            {</p><p>                _entities = new FindDoctorEntities();</p><p>            }</p><p>            return _entities.Physicians;</p><p>        }</p><p></p><p>and someone execute /api/physicians?$filter=FirstName+eq+&#39;Jon&#39;</p><p></p><p>The generated query will be something like WHERE FIRST_NAME = &#39;Jon&#39; which might not efficient in terms of performance and scare me in terms of SQL injection even though some kind of character escaping might be happening in the background to &quot;prevent it&quot;.</p><p></p><p>Do you know any way to avoiding such not parametrized query generated when using things like oData $filter?</p><p></p><p>Best,</p><p>Michel Fornaris</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/michel.fornaris.jpg?forceidenticon=false&amp;dt=635047936200000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by alexey.oyun</title><link>http://www.asp.net/web-api/videos/getting-started/paging-and-querying</link><pubDate>Thu, 30 Aug 2012 01:55:39 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016344</guid><description><![CDATA[ <p>I think OData is removed from final MVC4 source.</p><p>See <a rel="nofollow" href="http://stackoverflow.com/a/10974045" target="_blank">stackoverflow.com/</a> and <a rel="nofollow" href="http://aspnetwebstack.codeplex.com/SourceControl/changeset/af11adf6b3c5" target="_blank">aspnetwebstack.codeplex.com/</a></p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/alexey.oyun.jpg?forceidenticon=false&amp;dt=635047936200000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by sinedyip</title><link>http://www.asp.net/web-api/videos/getting-started/paging-and-querying</link><pubDate>Tue, 20 Nov 2012 12:03:50 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016835</guid><description><![CDATA[ <p>Thank you good video</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/sinedyip.jpg?forceidenticon=false&amp;dt=635047936200000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>