示例#1
0
        public async Task <IActionResult> GetProduct(int id)
        {
            var spec    = new ProductsWithTypesAndBrandsSpecification(id);
            var product = await _productRepo.GetBySpecification(spec);

            if (product == null)
            {
                return(NotFound(new ApiResponse(404)));
            }
            return(Ok(_mapper.Map <Product, ProductToReturnDto>(product)));
        }