Skip to content

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

Merged
SergeiPavlov merged 1 commit into
master-servicetitanfrom
ToArrayAsync
Feb 10, 2024
Merged

Fallback ToListAsync() to .ToList() when IAsyncEnumerable is not available#180
SergeiPavlov merged 1 commit into
master-servicetitanfrom
ToArrayAsync

Conversation

@SergeiPavlov

@SergeiPavlov SergeiPavlov commented Feb 9, 2024

Copy link
Copy Markdown
Collaborator

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