コード例 #1
0
        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"
                });
            }
        }
コード例 #2
0
 public List <Department> GetAll()
 {
     return(_departmentRepository.GetAll().ToList());
 }
コード例 #3
0
 public IEnumerable <Department> ReadAll()
 {
     return(_DepartmentRepo.GetAll());
 }