Exemplo n.º 1
0
 private static void ReadBlog(BlogService.BlogServiceClient client)
 {
     try
     {
         var response = client.ReadBlog(new ReadBlogRequest()
         {
             BlogId = "609f98080201f0caaa80e5"
         });
         Console.WriteLine(response.Blog.ToString());
     }
     catch (RpcException ex)
     {
         Console.WriteLine(ex.Status.Detail);
     }
 }
Exemplo n.º 2
0
 private static void ReadBlog(BlogService.BlogServiceClient client)
 {
     try
     {
         var response = client.ReadBlog(new ReadBlogRequest()
         {
             BlogId = "5f43d20c3f7f04ca26460d27"
         });
         Console.WriteLine(response.Blog.ToString());
     }
     catch (RpcException ex) when(ex.StatusCode == StatusCode.NotFound)
     {
         Console.WriteLine(ex.Status.Detail);
     }
 }
        private static void ReadBlog(BlogService.BlogServiceClient client)
        {
            try
            {
                var response = client.ReadBlog(new ReadBlogRequest()
                {
                    BlogId = "5dc06aeb807d5b450456803d"
                });

                Console.WriteLine(response.Blog.ToString());
            }
            catch (RpcException e)
            {
                Console.WriteLine(e.Status.Detail);
            }
        }
Exemplo n.º 4
0
        private static void ReadBlog(BlogService.BlogServiceClient client)
        {
            try
            {
                var response = client.ReadBlog(new ReadBlogRequest()
                {
                    BlogId = "60348bf79d7fbea245ac5bcc"
                });

                Console.WriteLine(response.Blog.ToString());
            }
            catch (RpcException e)
            {
                Console.WriteLine(e.Status.Detail);
            }
        }
Exemplo n.º 5
0
        private static void ReadBlog(BlogService.BlogServiceClient client)
        {
            try
            {
                var response = client.ReadBlog(new ReadBlogRequest()
                {
                    BlogId = "5f01f42aa54e154aace7f0d9"
                });

                Console.WriteLine(response.Blog.ToString());
            }
            catch (RpcException e)
            {
                Console.WriteLine(e.Status.Detail);
            }
        }
Exemplo n.º 6
0
        private static void GetByIdBlog(BlogService.BlogServiceClient client)
        {
            try
            {
                ReadBlogResponse response = client.ReadBlog(new ReadBlogRequest()
                {
                    BlogId = "5e91e157d31ecb45c8f84714"
                });

                Console.WriteLine(response.Blog.ToString());
            }
            catch (RpcException e)
            {
                Console.WriteLine(e.Status.Detail);
            }
        }
Exemplo n.º 7
0
        public static string readBlog(BlogService.BlogServiceClient client)
        {
            try
            {
                var response = client.ReadBlog(new ReadBlogRequest()
                {
                    BlogId = "5f9f0f21a772b24eadb150a8"
                });

                return("Get a Blog : " + response);
            }
            catch (System.IO.IOException e)
            {
                Console.WriteLine("client error:" + e.Message);
                throw;
            }
        }