Hi
in Books.razor Component , this is my Adaptor.cs , Books.razor , Service and Repository
my problem is when i Update a record in Edit.razor when the record is updated i navigate to books.razor
but when navigate to books.razor ,
it's get book Status On OnInitializedAsync then go to Adaptor to get the grid data in repository when but request to database it's show this error :
a second operation was started on this context instance before a previous operation completed. this is usually caused by different threads concurrently using the same instance of dbcontext. for more information on how to avoid threading issues with dbcontext
1.i check the async / await
2.change program.cs to :
builder.Services.AddDbContext(options => options.UseSqlServer(connectionString),ServiceLifetime.Transient);
and then change again to and test it
builder.Services.AddDbContext(options => options.UseSqlServer(connectionString),ServiceLifetime.Scoped);
but it's not worked and show error again
Note : When i Remove these codes in books.razor it's worked
ScrambleStatus = await scrambleService.GetStatus();
ScrambleStatus.Insert(0, "All");
SelectedStatus = ScrambleStatus.First(); Copy
is problem on my call async / await ?
what's problem ?