Ejemplo n.º 1
0
        public async Task <ApiResponse> Post([FromBody] PostPriorityDTO arg)
        {
            try
            {
                var data = await priorityService.CreateAsync(arg);

                return(new ApiResponse(InfoMessages.PriorityAdded, data, HttpStatusCode.OK.ToInt()));
            }
            catch (ValidationException ex)
            {
                throw new ApiException(ex.Errors, ex.StatusCode);
            }
            catch (CustomException ex)
            {
                throw new ApiException(ex, ex.StatusCode);
            }
            catch (Exception ex)
            {
                throw new ApiException(ex);
            }
        }