I have run into problems following the Help Desk example in the Blazor Succinctly book. All was going well until I got to try the 'Edit' and 'Delete' buttons on the Administration grid (page 72). At this point I got the error shown in full below that I couldn't resolve.
I downloaded the complete source from the github page (https://github.com/ADefWebserver/SyncfusionHelpDesk)and ran it without problems.
Using the NuGet package manager I upgraded the Microsoft packages from 3.1.2 to 3.1.7, and System.Text.Json to 4.7.2 The program ran without problems.
However, when I upgraded Synfusion.Blazor from 18.1.0.42 to 18.2.0.54 the error occurred.
I feel the problem is related to the latest (or recent) release of Syncfusion.Blazor
ERROR - Line 121/122 of Administration.razor
System.InvalidOperationException
HResult=0x80131509
Message=Invalid attempt to call ReadAsync when reader is closed.
Source=Microsoft.Data.SqlClient
StackTrace:
at Microsoft.Data.Common.ADP.ExceptionWithStackTrace(Exception e)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.AsyncEnumerator.<MoveNextAsync>d__17.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult()
at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.<SingleOrDefaultAsync>d__22`1.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.<SingleOrDefaultAsync>d__22`1.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at SyncfusionHelpDesk.Data.SyncfusionHelpDeskService.<GetHelpDeskTicketAsync>d__3.MoveNext() in C:\Users\Christopher\OneDrive - XXX\Blazor\SyncfusionHelpDesk-main\SyncfusionHelpDesk-main\Data\SyncfusionHelpDeskService.cs:line 35
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at SyncfusionHelpDesk.Pages.Administration.<OnCommandClicked>d__20.MoveNext() in C:\Users\Christopher\OneDrive - XXX\Blazor\SyncfusionHelpDesk-main\SyncfusionHelpDesk-main\Pages\Administration.razor:line 121
This exception was originally thrown at this call stack:
[External Code]
SyncfusionHelpDesk.Data.SyncfusionHelpDeskService.GetHelpDeskTicketAsync(string) in SyncfusionHelpDeskService.cs
[External Code]
SyncfusionHelpDesk.Pages.Administration.OnCommandClicked(Syncfusion.Blazor.Grids.CommandClickEventArgs<SyncfusionHelpDesk.Data.HelpDeskTickets>) in Administration.razor