[CSHARP-2103] Make Query Syntax Async method! Created: 18/Nov/17  Updated: 05/Apr/19  Resolved: 23/Jan/18

Status: Closed
Project: C# Driver
Component/s: Linq
Affects Version/s: 2.4.4
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: Danny Chu [X] Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: question
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible

 Description   

There are no async method in Linq Query Syntax when you want to retrieve an object.

For example:

var peter = await (from x in collection.AsQueryable()
where x.Name == "Peter"
select x).FirstOrDefaultAsync();

This will create an error. FirstOrDefaultAsync() does not exist. However, FirstOrDefault() does exit.

But the async method exists in Linq Method Syntax.

I also wrote it in Stackoverflow here: https://stackoverflow.com/questions/47169729/is-mongodb-c-sharp-driver-linq-query-syntax-missing-async-method?noredirect=1#comment81290069_47169729

It would be so awesome if we could get this feature



 Comments   
Comment by Danny Chu [X] [ 19/Nov/17 ]

Okay, it exists anyway. A new answer was made on the Stackoverflow.
How do i close this case?

Generated at Wed Feb 07 21:41:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.