Q:

What is the mistake I am making in the below C# code?

I have an interface like
interface IEmpDeptRepository : IEmployeeRepository,IDepartmentRepository
 {
        IEnumerable<EmpDept> GetAll();        
 }

interface IEmployeeRepository
{
        IEnumerable<Employee> GetAll();       
}

interface IDepartmentRepository
{
        IEnumerable<Department> GetAll();        
}

The Class EmpDept is
 class EmpDept 
        {
            public List<Employee> Employees { get; set; }
            public List<Department> Departments { get; set; }    
        }

Now the class EmpDeptRepository is as under
 public class EmpDeptRepository:IEmpDeptRepository
    {
        private List<EmpDept> empDepts = new List<EmpDept>();

        public EmpDeptRepository()
        {

            Add(new EmpDept { Employees = IEmployeeRepository.GetAll(), Departments = IDepartmentRepository.GetAll() });            
        }

        public EmpDept Add(EmpDept empDept)
        {
            if (empDept == null)
            {
                throw new ArgumentNullException("Employee Department");
            }            
            empDepts.Add(empDept);
            return empDept;
        }

        public IEnumerable<EmpDept> GetAll()
        {
            return empDepts;
        }

        IEnumerable<Employee> IEmployeeRepository.GetAll()
        {
            IEmployeeRepository employeeRepository = new EmployeeRepository();
            return employeeRepository.GetAll();
        }

        IEnumerable<Department> IDepartmentRepository.GetAll()
        {
            IDepartmentRepository deptRepository = new DepartmentRepository();
            return deptRepository.GetAll();
        }
    }

And I am getting the below error
Error   1   Inconsistent accessibility: parameter type 'Models.EmpDept' is less accessible than method 'Models.EmpDeptRepository.Add(Models.EmpDept)'
Error   2   Inconsistent accessibility: return type 'Models.EmpDept' is less accessible than method 'Models.EmpDeptRepository.Add(Models.EmpDept)'
Error   3   Inconsistent accessibility: return type 'System.Collections.Generic.IEnumerable<Models.EmpDept>' is less accessible than method 'Models.EmpDeptRepository.GetAll()'

What is the mistake..please help?

A:

Make all your classes public:
public class EmpDept 

