Inconsistent accessibility: return type ‘list‘ is less accessible than method ‘IEmployeeDAL.SelectAllEmployee()’

Using Dependency Injection Constructor code this error often comes and many of them do not know about that error. In this article, I will show how to resolve this error.

C# Inconsistent Accessibility Video:

Follow these steps to solve this error

  • First, click on that error
Inconsistent accessibility: return type is less accessible than method
  • Put the Curser on the employee and click on it and press F12
List of Employee Error
List of Employee
  • Then you will go to the definition of that class
Class With Property Define
  • Just write Public with that class and the error has gone.
Public class with property definition
  • That’s it error has gone.
  • Watch the video for a better understanding.

5 thoughts on “Inconsistent accessibility: return type ‘list<Employee>‘ is less accessible than method ‘IEmployeeDAL.SelectAllEmployee()’”

Leave a Comment