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))); }