Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Dependency Injection error: Unable to resolve service for

I created an .NET Core MVC application and use Dependency Injection and Repository Pattern to inject a repository to my controller. However, I am getting an error:

enter image description here

EfCategoryDal:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

GenericRepository

enter image description here

CategoryManager
enter image description here

ICategoryService
enter image description here

CategoryController
enter image description here

Startup
enter image description here

I’m not sure what I’m doing wrong. Any ideas?

Thanks

>Solution :

enter image description here
startup.cs

services.AddDbContext<Context>();
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading