Skip to content

Instantly share code, notes, and snippets.

@cheoalfredo
Created November 10, 2020 22:07
Show Gist options
  • Save cheoalfredo/cf4ae7c6d92ddfe58ffcdf2843d82244 to your computer and use it in GitHub Desktop.
Save cheoalfredo/cf4ae7c6d92ddfe58ffcdf2843d82244 to your computer and use it in GitHub Desktop.
C# gRPC Server
using System.Threading.Tasks;
using Grpc.Core;
namespace MyServer
{
public class OperacionService : OperacionMatematica.OperacionMatematicaBase
{
public override Task<DivisionResponse> Divide(DivisionRequest request, ServerCallContext context)
{
var result = new DivisionResponse();
result.Cociente = request.Dividendo / request.Divisor;
result.Residuo = request.Dividendo % request.Divisor;
return Task.FromResult(result);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment