30. public class TestService : MagicOnionService
{
// define public method
public async Task<int> Sum(int x, int y)
{
return x + y;
}
public async Task<string> Download(string url)
{
// async/await support
var result = await new HttpClient().GetStringAsync(url);
return result;
}
}
struct DynamicTuple
{
public int x;
public int y;
}
31. // standard gRPC connection
var channel = new Channel("127.0.0.1:12345");
// Client will be run-time generated as “.Create<TService>()” and called seamlessly.
var result = await MagicOnionClient.Create<TestService>(channel).Sum(100, 200);