-1

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?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

0

I need to get all data.

Create a stored procedure and extract the full total data rows/columns as needed.

ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122
  • Could you please explain in details? – Dzmitriy0705 Jan 08 '21 at 13:20
  • If you can create a sproc or sprocs which will return the full set of data, why not call and extract the data that way? See [How to call a stored procedure with EF](https://stackoverflow.com/questions/20901419/how-to-call-stored-procedure-in-entity-framework-6-code-first) – ΩmegaMan Jan 08 '21 at 15:05