示例#1
0
        public async Task <ActionResult <ProductToReturnDto> > GetProduct(int id)
        {
            var spec        = new ProductsWithTypesAndBrandsSpecification(id);
            var Fullproduct = await _productRepo.GetEntityWithSpecAsync(spec);

            if (Fullproduct == null)
            {
                return(NotFound(new ApiResponse(404)));
            }


            return(Ok(_mapper.Map <Product, ProductToReturnDto>(Fullproduct)));
        }