forked from simplefx/Simple.OData
-
Notifications
You must be signed in to change notification settings - Fork 200
Retrieving all data from a collection
Vagif Abilov edited this page Nov 20, 2013
·
28 revisions
Untyped syntax
var products = _client .For("Products") .FindEntries(); Assert.NotEmpty(products);
Typed syntax
var products = _client .For<Products>() .FindEntries(); Assert.NotEmpty(products);
Dynamic syntax
var x = ODataDynamic.Expression; var products = _client .For(x => x.Products) .FindEntries(); Assert.NotEmpty(products);
Request URI: GET Products
Untyped syntax
var count = _client .For("Products") .Count() .FindScalar(); Assert.True(count > 0);
Typed syntax
var count = _client .For<Products>() .Count() .FindScalar(); Assert.True(count > 0);
Dynamic syntax
var x = ODataDynamic.Expression; var count = _client .For(x => x.Products) .Count() .FindScalar(); Assert.True(count > 0);
Request URI: GET Products/$count
Untyped syntax
Promise<int> count; var products = _client .For("Products") .FindEntries(true, out count); Assert.NotEmpty(products); Assert.True(count > 1);
Typed syntax
Promise<int> count; var products = _client .For<Products>() .FindEntries(true, out count); Assert.NotEmpty(products); Assert.True(count > 1);
Dynamic syntax
Promise<int> count; var x = ODataDynamic.Expression; var products = _client .For(x => x.Products) .FindEntries(true, out count); Assert.NotEmpty(products); Assert.True(count > 1);
Request URI: GET Products?$top=1&$inlinecount=allpages
See also:
Retrieving data