Example #1
0
 public override Task <GetPostByIdResponse> GetPostById(GetPostByIdRequest request, ServerCallContext context)
 {
     try
     {
         var post        = new PostComment.Post();
         var returnValue = post.GetPostById(request.Id);
         var response    = new GetPostByIdResponse {
             Value = (Post)returnValue
         };
         return(Task.FromResult(response));
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, "Error invoking GetPostById");
         throw new RpcException(new Status(StatusCode.Internal, ex.Message));
     }
 }