public Task <ObjParam> SendObjectWithResult(ObjParam param) { string value = JsonConvert.SerializeObject(param); Console.WriteLine(value); return(Task.FromResult(param)); }
private static void ObjParamWithResultTest(HubConnection connection) { var param = new ObjParam() { Id = 1, Name = "zhangchao", Message = new Message { Id = 1, Name = "hello", } }; // Console.WriteLine(JsonConvert.SerializeObject(param1)); Console.WriteLine(JsonConvert.SerializeObject(connection.InvokeAsync <ObjParam>("SendObjectWithResult", param).Result)); }