Exemplo n.º 1
0
        public async Task <ActionResult <RemoveProductOptionItemOutputModel> > Delete(Guid aProductId, Guid aOptionId)
        {
            try
            {
                RemoveProductOptionOutputDto result = await _aProductOptionService.RemoveProductOption(new RemoveProductOptionInputDto()
                {
                    Id = aOptionId
                });

                if (result.ResultSuccess)
                {
                    return(_aMapper.Map <RemoveProductOptionItemOutputModel>(result));
                }
                return(StatusCode(StatusCodes.Status500InternalServerError, result.ResultErrors.Messages.First()));
            }
            catch (Exception e)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, "Server Error"));
            }
        }