public async Task <GetProductOptionDetailOutputDto> GetProductOptionDetail( GetProductOptionDetailInputDto aParams) { var output = new GetProductOptionDetailOutputDto(); try { var result = await UnitOfWork.ProductOptionRepository.GetProductOptionByDetailsAsync(aParams.Id); output = Mapper.Map <GetProductOptionDetailOutputDto>(result); return(output); } catch (Exception e) { output.ResultErrors.Messages.Add(e.Message); } return(output); }
public async Task <ActionResult <GetProductOptionItemOutputByIdAndProductIdModel> > Get(Guid aProductId, Guid aOptionId) { try { GetProductOptionDetailOutputDto result = await _aProductOptionService.GetProductOptionDetail(new GetProductOptionDetailInputDto() { Id = aOptionId }); if (result.ResultSuccess) { var output = _aMapper.Map <GetProductOptionItemOutputByIdAndProductIdModel>(result); return(output); } return(StatusCode(StatusCodes.Status500InternalServerError, result.ResultErrors.Messages.First())); } catch (Exception e) { return(StatusCode(StatusCodes.Status500InternalServerError, "Server Error :" + e.Message)); } }