JsonApiDotNetCore.Repositories.IDbContextResolver Error
See original GitHub issueDescription
InvalidOperationException: Unable to resolve service for type ‘JsonApiDotNetCore.Repositories.IDbContextResolver’ while attempting to activate 'JsonApiDotNetCore.Repositories.EntityFrameworkCoreRepository`2
Environment
- JsonApiDotNetCore Version: 4.0.0-beta1
I am not using EF Core at all - just a basic API that references a library project in the same solution. I am very confused about the EntityFrameworkCoreRepository and it’s need in the project(which I won’t be using in the solution).
Please help in resolving this issue.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Namespace JsonApiDotNetCore.Errors
The error that is thrown when assigning and referencing a local ID within the same operation. MissingResourceInRelationship · MissingTransactionSupportException.
Read more >Namespace JsonApiDotNetCore.Repositories
The error that is thrown when the underlying data store is unable to persist changes. DbContextExtensions · DbContextResolver<TDbContext>.
Read more >Class JsonApiException
The base class for an Exception that represents one or more JSON:API error objects in an unsuccessful response. [PublicAPI] public class JsonApiException ...
Read more >Class JsonApiOptions
Indicates whether responses should contain a jsonapi object that contains the highest JSON:API version supported. False by default. public bool ...
Read more >Class Identifiable<TId>
A convenient basic implementation of IIdentifiable<TId> that provides conversion between typed Id and StringId. public abstract class Identifiable<TId> ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @bluedog13,
EntityFrameworkCoreRepository
is used by default as backing store byJsonApiResourceService
. See here for an overview.If not using EF Core, you can replace the repository with a custom implementation of
IResourceRepository<TResource, TId>
, which is injected in the service. Or even replace the service layer too, by injecting your own service layer in controllers.If you’re stuck and need help, please share your controller/service classes (just the class and constructor signature should be enough) and any custom registrations for them you have in Startup.cs. It would even be better to share a repro-project so we can analyze what is going on.
Glad to hear this works for you now.