-
-
Notifications
You must be signed in to change notification settings - Fork 22
LINQ AsyncEnumerableExtensions
ZZZ Projects edited this page Jan 24, 2016
·
1 revision
Async Task extension methods allow to perform operation on IEnumerable<Task<T>>.
Support:
- OrderByCompletion
- SelectResult
- SelectResultByCompletion
// Using Z.Linq
public async Task<List<Customer>> MyAsyncTaskMethod(CancellationToken cancellationToken)
{
int customerID = 4;
// GET customer from concurrent web service
IEnumerable<Task<List<Customer>>> task = WebService.GetCustomers(4);
// GET the customer list from the first web service completed
var taskFirstCompleted = task.SelectResultByCompletion()
.First();
// GET the five first customers which the predicate has completed
var task = taskFirstCompleted.WhereAsync(c => MyAsyncPredicate(DB.IsCustomerActiveAsync(c)))
.OrderByPredicateCompletion()
.Take(5)
.ToList();
// ... synchronous code ...
return task;
}
Entity Framework
Bulk Operations
Expression Evaluator
Others
Need more info? info@zzzprojects.com
Contact our outstanding customer support for any request. We usually answer within the next business day, hour, or minutes!