Cannot access a disposed object in ASP.NET Core working with DbContext

Bump into this error and found out the reason you cannot spin up a task to run a injected DbContext which normally injected by WebAPI dependency injection of a DbContext.


Create your dbcontext manually using code below (instead of using DbContext passed in the controller)


Popular posts from this blog

PySpark - Working with JDBC Sqlite database