Closed
Description
Combining the context builder with the DbContext generic, fails with the subject error.
services.AddJsonApi<DbContext>(opt => {
opt.BuildContextGraph(builder => {
builder.AddResource<MyEntity>("my-entity");
});
});
Attempting to add the use the non-generic form fails with:
Cannot resolve parameter 'Microsoft.EntityFrameworkCore.DbContext context' of constructor...
A temporary fix is to specify the dbContext in both generics:
services.AddJsonApi<DbContext>(opt => {
opt.BuildContextGraph(builder => {
builder.AddDbContext<DbContext>();
builder.AddResource<MyEntity>("my-entity");
});
});