Exemplo n.º 1
0
        public async Task <IActionResult> GetAllEmployees()
        {
            List <Entities.Concrete.Employee.Employee>  employeesList = null;
            ActionResultResponse <EmployeeListResponse> response;

            try
            {
                employeesList = _service.GetAllEmployees();
                response      = EmployeeMapper.EmployeeGetAllToActionResult(employeesList);
            }
            catch (Exception ex)
            {
                LogException.WriteLog(ex, "EmployeeController.InsertEmployee", JsonSerializer.Serialize(employeesList), LogType.Error);
                response = new ActionResultResponse <EmployeeListResponse>(System.Net.HttpStatusCode.InternalServerError, MessageException.GetGeneralMessage(ex), null);
            }
            return(GetResponse(response));
        }