AddEntityFrameworkStores expects a concrete implementation and AddDbContext<TContextService, TContextImplementation> does not bind the concrete implementation
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 276
Description
I am not sure whether this is actually an issue or just a misunderstanding and I am not sure what the best fix for this would be but when using a service interface and an implementation for `AddDbContext` the actual context is not configured for injection so any attempt to use EntityFramework identity stores (e.g. `UserStore` via `UserManager`) results in an exception because the context cannot be injected.
```
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext();
services.AddIdentity()
.AddEntityFrameworkStores();
}
```
You can work around this by manually binding the context ([as described here](https://stackoverflow.com/questions/52347535)) but it definitely does not feel ideal.
Contributor guide
Assessment
This issue has not been assessed yet.