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)); }
private async Task ValidateProduct(int id) { var product = await QuotesRepository.GetProductAsync(id); if (product == null) { throw new NotFoundItemException($"cannot found product with id:{id}"); } }