-
Notifications
You must be signed in to change notification settings - Fork 217
Retrieving all data matching search criteria specified in a method name
object edited this page Oct 9, 2012
·
7 revisions
Simple.Data method FindAllBy is used to retrieve all data that satisfy search criteria.
IEnumerable<dynamic> products = _db.Products.FindAllByProductName("Chai"); Assert.NotEmpty(products);
Request URI: GET Products?$filter=ProductName+eq+%27Chai%27
IEnumerable<dynamic> products = _db.Products.FindAllByProduct_Name("Chai"); Assert.NotEmpty(products);
Request URI: GET Products?$filter=ProductName+eq+%27Chai%27
var count = _db.Products.FindAllByProductName("Chai").Count(); Assert.Equal(1, count);
Request URI: GET Products/$count?$filter=ProductName+eq+%27Chai%27
Promise<int> count; IEnumerable<dynamic> products = _db.Products.FindAllByProductName("Chai").WithTotalCount(out count).Take(1); Assert.NotEmpty(products); Assert.Equal(1, count);
Request URI: GET Products?$filter=ProductName+eq+%27Chai%27&$top=1&$inlinecount=allpages
See also:
Retrieving data
Simple.Data documentation for FindAll