static void Main(string[] args) { GetMsgSumReply helloMsg = HelloClient.getSum(11, 2); GetLotAll getLotAll = HelloClient.GetLotAll(132, "我是老哈哈哈哈"); Console.WriteLine("grpc Client Call GetSum():" + helloMsg.Sum); string user = string.Empty; foreach (var item in getLotAll.User) { user += item; } Console.WriteLine("grpc Client Call GetLotAll():" + user); Console.WriteLine("任意键退出..."); Console.ReadKey(); }
public override async Task <GetLotAll> test(GetLotID request, ServerCallContext context) { var result = new GetLotAll(); string s = "这里一共有:"; if (request.Num1 == 1) { s += "1个字符"; } s += request.S; UserList userList = new UserList(); userList.UserName = "******"; result.User.Add(userList); List <UserList> userLists = new List <UserList>(); result.User.AddRange(userLists); result.T = GetLotAll.Types.Lists.Wip; return(result); }