You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having trouble injecting EF Core into my MVC Web application (framework 4.6.1). I have a SO question here but to summerize:
I am binding the DbContext to itself in transient scope but it seems that the context instance is being reused and then it fails because EF has closed the connections. In the controller method I make a call to the db in one repository which works and then I make a call to the db in a different repository which fails and throws an exception.
No database provider has been configured for this DbContext. A provider can be configured by overriding the DbContext.OnConfiguring method or by using AddDbContext on the application service provider. If AddDbContext is used, then also ensure that your DbContext type accepts a DbContextOptions object in its constructor and passes it to the base constructor for DbContext.
Code examples are in the SO question.
The text was updated successfully, but these errors were encountered:
I am having trouble injecting EF Core into my MVC Web application (framework 4.6.1). I have a SO question here but to summerize:
I am binding the DbContext to itself in transient scope but it seems that the context instance is being reused and then it fails because EF has closed the connections. In the controller method I make a call to the db in one repository which works and then I make a call to the db in a different repository which fails and throws an exception.
Code examples are in the SO question.
The text was updated successfully, but these errors were encountered: