Beispiel #1
0
        public Task <ObjParam> SendObjectWithResult(ObjParam param)
        {
            string value = JsonConvert.SerializeObject(param);

            Console.WriteLine(value);
            return(Task.FromResult(param));
        }
Beispiel #2
0
        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));
        }