コード例 #1
0
        public override async Task <ProductDto> GetProduct(ProductIdDto request, ServerCallContext context)
        {
            var product = await _productApplication.GetProductAsync(request.Id);

            var result = product == null ? null : product.ToProductDto();

            return(result);
        }
コード例 #2
0
        public override async Task <UpdatedResultDto> Delete(ProductIdDto request, ServerCallContext context)
        {
            var result = await _productApplication.DeleteProduct(request.Id);

            return(new UpdatedResultDto()
            {
                Count = result
            });
        }