{"id":1893,"date":"2008-12-15T16:18:34","date_gmt":"2008-12-15T16:18:34","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/odatateam\/2008\/12\/15\/design-notes-row-count\/"},"modified":"2008-12-15T16:18:34","modified_gmt":"2008-12-15T16:18:34","slug":"design-notes-row-count","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/odata\/design-notes-row-count\/","title":{"rendered":"Design Notes: Row Count"},"content":{"rendered":"<p>One of the scenarios we have heard feedback around is the ability for the a client of a data service to determine the total number of entities in a set without having to retrieve them all. The following video discusses this scenario in more detail and some of our thoughts regarding how to make the experience better.&#160; <\/p>\n<p>&#160;<\/p>\n<p><a href=\"https:\/\/channel9.msdn.com\/posts\/Andrew+Conrad\/Astoria-Design-Walkthrough-Introducing-count-as-an-URI-query-option\/\">Astoria Design Walkthrough: Introducing $count as an URI query option<\/a>     <\/p>\n<p>&#160;<\/p>\n<p><strong>Additional design details<\/strong>:<\/p>\n<p>&#8211; The count value would be calculated after $filter expressions are applied.&#160; For example \/Customers?$filter=City eq &#8216;London&#8217; would return a count value made up of <strong>only<\/strong> the customers living in London and not all the customers.<\/p>\n<p>&#8211; If a query included $top, $skip or $orderby, the count value would be unaffected.&#160; For example \/Customers?$top=1&amp;$skip=2&amp;$orderby=Name would return the total number of customers stored by the service.<\/p>\n<p>&#8211; If a query includes a $expand, then the count applies to the outer entity set.&#160; For example \/Customers?$expand=Orders would return the number of customers stored by the service<\/p>\n<p>&#160;<\/p>\n<p>What do you think?&#160; Would this be useful in your data services applications?<\/p>\n<p>&#160;<\/p>\n<p>Mike Flasko<\/p>\n<p>ADO.NET Data Services, Program Manager<\/p>\n<p>&#160;<\/p>\n<p>This post is part of the transparent design exercise in the Astoria Team. To understand how it works and how your feedback will be used please look at <a href=\"https:\/\/blogs.msdn.com\/astoriateam\/archive\/2007\/07\/20\/transparency-in-the-design-process.aspx\">this post<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the scenarios we have heard feedback around is the ability for the a client of a data service to determine the total number of entities in a set without having to retrieve them all. The following video discusses this scenario in more detail and some of our thoughts regarding how to make the [&hellip;]<\/p>\n","protected":false},"author":512,"featured_media":3253,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[27,28],"class_list":["post-1893","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-odata","tag-design-notes","tag-design-video"],"acf":[],"blog_post_summary":"<p>One of the scenarios we have heard feedback around is the ability for the a client of a data service to determine the total number of entities in a set without having to retrieve them all. The following video discusses this scenario in more detail and some of our thoughts regarding how to make the [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/posts\/1893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/users\/512"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/comments?post=1893"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/posts\/1893\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/media\/3253"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/media?parent=1893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/categories?post=1893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/tags?post=1893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}