AspNetCore.Docs/aspnetcore/grpc/services/GreeterBase.cs

24 lines
457 B
C#

using Grpc.Core;
namespace GrcpServices;
// <snippet_GreeterBase>
public abstract partial class GreeterBase
{
public virtual Task<HelloReply> SayHello(HelloRequest request, ServerCallContext context)
{
throw new RpcException(new Status(StatusCode.Unimplemented, ""));
}
}
public class HelloRequest
{
public string Name { get; set; }
}
public class HelloReply
{
public string Message { get; set; }
}
// </snippet_GreeterBase>