asynchronous - How to await a ParallelQuery with LINQ? -
i have async method, should database entries. filters name, candiate parallel execution. however, can not find simple way support both parallel execution , asynchronous tasks. here's have: private async task<list<item>> getmatchingitems(string name) { using (var entities = new entities()) { var items = item in entities.item.asparallel() item.name.contains(name) select item; return await items.tolistasync(); //complains "parallelquery<item> not contain definition tolistasync..." } } when remove asparallel() compile. not supposed use both features @ same time? or understand wrong? ihmo, both make sense: asparallel() indicate database query may split several sub-queries running @ same time, because individual matching of item not dependent on other item. update: bad idea in example, see comments , answer! tolistasync() support asynchronous execution of method, allow other match meth...