I have this method:
public async Task<ProductReport<ProductPrice>> GetCurrentProductsReport()
{
var query = (DataServiceQuery<ProductPrice>)(
from p in this.entities.Products
where !p.Discontinued
orderby p.ProductName
select new ProductPrice
{
Name = p.ProductName,
Price = p.UnitPrice ?? 0,
});
var result = await Task<IEnumerable<ProductPrice>>.Factory.FromAsync(query.BeginExecute(null, null), (ar) =>
{
return query.EndExecute(ar);
});
return new ProductReport<ProductPrice>(result);
}
This method returns an incomplete list of products. The number of items in the list is limited by the number of items that the service returns in one request. I need to get all data.
I know I can use the GetContinuation()
method, but I can't use it in this situation.
Maybe someone knows how to solve this problem?