-
Notifications
You must be signed in to change notification settings - Fork 10.3k
[Blazor] Improve the experience with QuickGrid and EF Core #58716
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
Comments
I'm working with the BlazorWebAppMovies sample, so my observation/recommendation stems from that and @guardrex has suggested I should put it here. The proposed implementation is better, but it still throws an exception, two in fact. In the sample, if you type fast enough or if server-side updates come in quick succession, following exceptions might be thrown: System.InvalidOperationException and System.Threading.Tasks.TaskCanceledException. The more frequent exception is thrown by the EF Core itself. As I understand from the EF ExecuteAsync documentation:
The less frequent exception is thrown by the SQL provider. It is Micrsofot.Data.SqlClient.SqlException wrapped in System.InvalidOperationException (0x80131904): The request failed to run because the batch is aborted, this can be caused by abort signal sent from client, or another request is running in the same session, which makes the session busy. I suggest following changes to the BlazorWebAppMovies sample and perhaps in here:
Exceptions that need handling:
|
Getting QuickGrid to work correctly with EF is hard and requires using the
ItemsProvider
interface in order to avoid issues with concurrent queries that might be triggered with any action defined on the form.Switching to
ItemsProvider
is not trivial (had to look up the implementation from our QuickGrid implementation) and could be simplified with a few additional methods on the request, to applySkip
andTake
automatically or a more generalApplyRequestParameters
method that applies all of them.The implementation with EF should be simpler since this is a main scenario.
Originally posted by @javiercn in #58669
The text was updated successfully, but these errors were encountered: