GrpcEndpoints is a lightweight framework that simplifies gRPC service implementation in .NET by using an endpoint-centric approach. It eliminates boilerplate code through attribute-based mapping and dynamic service generation, allowing developers to focus on implementing business logic rather than repetitive service scaffolding.
- ✅ Eliminate boilerplate service implementation classes
- ✅ Attribute-based mapping of endpoints to gRPC methods
- ✅ Automatic registration of endpoints with dependency injection
- ✅ Dynamic creation of gRPC service implementations
- ✅ Cleaner separation of concerns with endpoint-focused architecture
dotnet add package GrpcEndpoints[GrpcEndpoint(typeof(Greeter.GreeterBase),nameof(Greeter.GreeterBase.SayHello))]publicclassSayHello:IGrpcEndpoint<HelloRequest,HelloReply>{publicTask<HelloReply>ExecuteAsync(HelloRequestrequest,ServerCallContextcontext,CancellationTokencancellationToken){returnTask.FromResult(newHelloReply{Message=$"Hello {request.Name} from GrpcEndpoints!"});}}// Program.csbuilder.Services.AddGrpcEndpoints();// Program.csapp.MapGrpcEndpoints<Greeter.GreeterBase>();MIT