I am working with a WCF data service pointing to an OData endpoint. If I use DataServiceQuery, I can handle the continuation without any problems.
var collection = new DataServiceCollection<T>();
collection.LoadCompleted += (sender, e) =>
{
if (e.Error != null)
{
callback(null, e.Error);
return;
}
var thisCollection = (DataServiceCollection<T>) sender;
if (thisCollection.Continuation != null)
{
thisCollection.LoadNextPartialSetAsync();
}
else
{
var items = thisCollection.ToList();
callback(items, e.Error);
}
};
collection.LoadAsync(query);
However, I do not see how you can do the same for the DataServiceContext.BeginExecute (string url, ...) method.
_odataContext.BeginExecute<T>(new Uri(requestUrl), x =>
{
var items = _odataContext.EndExecute<T>(x);
});
How can I use the url-based query method, but still get continuation support?
source
share