c# grpc 保姆级教学搭建grpc框架 服务端、客户端
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestNamespace
{
public class TestApp
{
public TestModel TestFun1(TestModel a)
{
return new TestModel(a.A - 1, a.B - 2);
}
public TestModel2 TestFun2(TestModel2 a)
{
TestModel2 tmp = new TestModel2();
tmp.C = a.B.Select(x => x + 1).ToList();
return tmp;
}
//public List<string> TestFun3(List<int> tmp)
//{
// return tmp.Select(x=>x.ToString()).ToList();
//}
//public void TestFun4(List<int> tmp)
//{
//}
}
public class TestModel
{
private int _A;
private int _B;
public TestModel(int a, int b)
{
A = a;
B = b;
}
public int A {
get => _A; set => _A = value; }
public int B {
get => _B; set => _B = value; }
}
public class TestModel2
{
private List<int> _C;
private List<int> _b;
public List<int> C {
get => _C; set => _C = value; }
public List<int> B {
get => _b; set => _b = value; }
}
}