Search code examples
c#asp.net-coreasp.net-core-mvcasp.net-core-3.1

Inconsistent accessibility: parameter type 'ICourseRepository' is less accessible than method ASP.NET Core MVC


I'm new to dtonet. I created repository and injected it into controller but got this error in controller constructor

Inconsistent accessibility: parameter type 'IContactRepository' is less accessible than method 'ContactController.ContactController(IContactRepository)'


Solution

  • You'll have to set IContactRepository as public in the file it is defined.

    public interface IContactRepository {
      ...
    }