How should I set to solve this problem?
Cannot access a disposed object. A common cause of this error is disposing a context that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling Dispose() on the context, or wrapping the context in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances.
Object name: 'RepositoryDbContext'.
Unsure this is a provider issue. See if you can replicate using SQLite EF Core Database Provider.
Mmmm, i do not know if that afects, but you are not using async right, you should be using Tasks
, not Threads
, and Task.Delay
, not Thread.Sleep
.
Your async method should return Task
, not void
, and if you could post the code as text and not as image could make easier for us to make some notes!, But like @mguinness i bet the problem is not in the provider
@antonioortizpola is right, the async void
is more than likely the issue, it needs to be async Task
and should be awaited in the Controller. Controller also needs to be made async
.
Most helpful comment
@antonioortizpola is right, the
async void
is more than likely the issue, it needs to beasync Task
and should be awaited in the Controller. Controller also needs to be madeasync
.