public async Task <IEnumerable <Department> > GetDepartments() { var departments = await _departmentRepository.GetDepartments(); return(_mapper.Map <IEnumerable <Department> >(departments)); //var departments = _mapper.Map<IEnumerable<DAL.Entities.Department>>(await _context.Departments.Include(department => department.Students).ToListAsync()); //return departments; }
public async Task <IEnumerable <DepartmentBLL> > GetDepartments() { var departmemts = await _departmentRepository.GetDepartments(); return(_mapper.Map <IEnumerable <DepartmentBLL> >(departmemts)); }