コード例 #1
0
        public async Task <GetProductResponse> GetProductByIdAsync(int productId, string email)
        {
            Product product = await _dataContext.Products
                              .AsNoTracking()
                              .SingleOrDefaultAsync(p => p.ProductId == productId);

            GetProductResponse response = _mapper.Map <GetProductResponse>(product);

            response.IsFavourite = await _favouriteService.IsProductFavourite(email, productId);

            return(response);
        }