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

async-sync-async switch #359

Open
mikasoukhov opened this issue Sep 25, 2022 · 1 comment
Open

async-sync-async switch #359

mikasoukhov opened this issue Sep 25, 2022 · 1 comment

Comments

@mikasoukhov
Copy link

GridBase.PreProcess uses sync Count call https://github.com/gustavnavar/Grid.Blazor/blob/master/GridCore/GridBase.cs#L52 In case of sync data source it will be normal behavior. But when we try use own data source (for example based on HttpClient data fetcher) we will get dead-lock here. I recommend use approach based on CountAsync method. Unfortunately, the method is available for EF data source only. So the best way will be introduce some interface-extension to let use code override on own source and make Count in async mode.

Sure, as a best code practice I recommend introduce cancellation token every where where is this call be.

I have my own implementation and can share it, but my approach is change underlying Expression tree to put CountAsync method call. Very non-generic.

@gustavnavar
Copy link
Owner

Can you send me your implementation?

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

No branches or pull requests

2 participants