private static async Task UpdateProductAsync(ProductProtoService.ProductProtoServiceClient client)
        {
            var replay = await client.UpdateProductAsync(new UpdateProductRequest
            {
                Product = new ProductModel
                {
                    ProductId   = 4,
                    Name        = "Test_2_1",
                    Description = "This is a test_2_1 product.",
                    Price       = 100,
                    Status      = ProductStatus.Instock,
                    CreatedTime = Timestamp.FromDateTime(DateTime.UtcNow)
                }
            });

            Console.WriteLine("After Update Product Obj:-" + replay.ToString());
        }
Exemplo n.º 2
0
        private static async Task UpdateProductAsync(ProductProtoService.ProductProtoServiceClient client)
        {
            Console.WriteLine("UpdateProductAsync started...");
            var updateProductResponse = await client.UpdateProductAsync(
                new UpdateProductRequest
            {
                Product = new ProductModel
                {
                    ProductId   = 1,
                    Name        = "Red",
                    Description = "New Red Phone Mi10T",
                    Price       = 699,
                    Status      = ProductStatus.Instock,
                    CreatedTime = Timestamp.FromDateTime(DateTime.UtcNow)
                }
            });

            Console.WriteLine("UpdateProductAsync Response: " + updateProductResponse.ToString());
        }