public ResponseApi GetDepartments() { try { List <Departments> lstDepartments = _IDepartmentsRepository.GetAll().ToList(); List <DepartmentsDto> lstDepartmentsDto = _mapper.Map <List <Departments>, List <DepartmentsDto> >(lstDepartments); return(new ResponseApi { ResponseType = "Success", ResponseStatus = true, ResponseObject = lstDepartmentsDto }); } catch (Exception Ex) { while (Ex.InnerException != null) { Ex = Ex.InnerException; } return(new ResponseApi { ResponseStatus = false, ResponseMessage = Ex.Message, ResponseType = "Error" }); } }
public List <Department> GetAll() { return(_departmentRepository.GetAll().ToList()); }
public IEnumerable <Department> ReadAll() { return(_DepartmentRepo.GetAll()); }