Exemple #1
0
        private static async Task ReadAll(BlogService.BlogServiceClient client)
        {
            var response = client.ListBlog(new ListBlogRequest());

            while (await response.ResponseStream.MoveNext())
            {
                Console.WriteLine($"Item read: {response.ResponseStream.Current.Blog}");
            }
            Console.WriteLine("All items are listed");
        }
        private static async Task ListBlog(BlogService.BlogServiceClient client)
        {
            var response = client.ListBlog(new ListBlogRequest()
            {
            });

            while (await response.ResponseStream.MoveNext())
            {
                Console.WriteLine(response.ResponseStream.Current.Blog.ToString());
            }
        }
 public static async Task ListBlogAsync(BlogService.BlogServiceClient client)
 {
     try
     {
         var response = client.ListBlog(new ListBlogRequest());
         while (await response.ResponseStream.MoveNext())
         {
             Console.WriteLine(response.ResponseStream.Current.Blog.ToString());
         }
     }
     catch (System.IO.IOException e)
     {
         Console.WriteLine("client error:" + e.Message);
         throw;
     }
 }
Exemple #4
0
        private static async Task ListBlog(BlogService.BlogServiceClient client)
        {
            try
            {
                var response = client.ListBlog(new ListBlogRequest());

                while (await response.ResponseStream.MoveNext())
                {
                    Console.WriteLine(response.ResponseStream.Current.Blog.ToString());
                }
            }
            catch (RpcException e)
            {
                Console.WriteLine(e.Status.Detail);
            }
        }