This repository demonstrates multiple gRPC API implementations for a simple ToDo application using .NET 9 and layered architecture. Each project showcases a different style or feature of gRPC communication.
- Email: vishwa@vishwa.me
- GitHub: Vishwam
- LinkedIn: Vishwa Kumar
Vishwa is the primary architect of the ToDoApp, responsible for the architecture and implementation of these features.
Data Access Layer
Implements Entity Framework Core using a local SQLite database. This layer contains the data model,DbContext, and theToDoItemrepository used by both gRPC APIs.
Pure gRPC Service (No JSON Transcoding)
Implements gRPC endpoints defined in.protofiles for managing ToDo items. Designed for internal or high-performance communication between microservices.
- ✅ High performance
- ❌ No Swagger / REST compatibility
- ✅ Supports tools like
grpcurl,Postman(with .proto or reflection) - 🚫 Not human-readable over HTTP (binary protocol)
gRPC with REST-style JSON Transcoding
UsesGrpc.AspNetCore.GrpcJsonTranscodingto expose the same gRPC service as a RESTful JSON API. Great for scenarios where external clients (e.g., frontends, mobile apps) need to use HTTP/JSON.
- ✅ gRPC and REST with single implementation
- ✅ Swagger/OpenAPI documentation available (accessible at
/swaggerwhen running) - ✅ Usable in Postman and Swagger UI
- ✅ gRPC reflection enabled for easy service discovery
- 📦 Slightly higher overhead due to transcoding
- Built on .NET 9 using a layered architecture
- Shared EF Core Data Layer for both gRPC APIs
- Local SQLite DB for ease of testing and development
- Easy-to-run and test each service independently
- Can be extended to include auth, validation, and advanced patterns (e.g., CQRS)
Each project contains its own .sln file so you can run them independently from Visual Studio or the CLI.
To run a project:
cd grpc-apis.styles.examples/src/ToDoApp.GrpcApi.Native # or ToDoApp.GrpcApi.Transcoding
dotnet runFor Native gRPC:
- Use gRPC clients or tools like
grpcurlor Postman (with gRPC support) - gRPC reflection is enabled for service discovery
For Transcoding:
- Access Swagger UI at
http://localhost:<port>/swagger(port configured in launchSettings.json) - Can be tested with standard HTTP/REST clients
- Also supports native gRPC clients
- .NET SDK 9+
- Visual Studio 2022 or VS Code
- EF Core tools (if working with migrations)
- Help developers understand different gRPC API implementation patterns.
- Enable experimentation and benchmarking.
- Provide a base for extending to Clean Architecture or CQRS in the future.
- Add MediatR-based APIs
- Add Clean Architecture sample
This project is licensed under the MIT License.