Exemplo n.º 1
0
        public async Task <Product> GetProductAsync(int id, int CategoryId)
        {
            var ProductEntity = await EcomakRepository.GetProductAsync(id);

            if (ProductEntity == null)
            {
                throw new NotFoundItemException("Product not found");
            }

            return(mapper.Map <Product>(ProductEntity));
        }
Exemplo n.º 2
0
        private async Task ValidateProduct(int id)
        {
            var product = await QuotesRepository.GetProductAsync(id);

            if (product == null)
            {
                throw new NotFoundItemException($"cannot found product with id:{id}");
            }
        }