Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback ToListAsync() to .ToList() when IAsyncEnumerable is not available #180

Merged
merged 1 commit into from
Feb 10, 2024

Conversation

SergeiPavlov
Copy link
Collaborator

@SergeiPavlov SergeiPavlov commented Feb 9, 2024

There are many non-Test cases where IAsyncEnumerable is not implemented
For example: nested .Select() in DO LINQ expressions:

var poData = await Session.Query.All<PurchaseOrder>()
            .Where(po => po.Id == purchaseOrderId)
            .Select(
                po => new {
                    InvoiceId = po.Invoice != null ? (long?)po.Invoice.Id : null,
                    Items = po.Items.Where(i => i.Active).Select(i => i.Id)
                })
            .SingleAsync();

They will fail without this change

@SergeiPavlov SergeiPavlov requested a review from botinko February 9, 2024 22:53
@SergeiPavlov SergeiPavlov merged commit 36ddc20 into master-servicetitan Feb 10, 2024
@SergeiPavlov SergeiPavlov deleted the ToArrayAsync branch February 10, 2024 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants