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.

Solution

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







Comments

Popular posts from this blog

A quick tutorial for OWASP ZAP tool for beginners

ionic2 cordova build android - Unable resolve gradle 2.2.3