Skip to content

A simple and well-structured example demonstrating how to implement gRPC services in .NET, including server and client communication.

Notifications You must be signed in to change notification settings

qandeel-codes/dotnet-grpc-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

.NET gRPC Sample

This repository contains a simple yet comprehensive example of using gRPC with .NET. It demonstrates how to build and run a basic gRPC server and client using .NET 9 with Protobuf for defining service contracts.

πŸ“Œ Features

  • βœ… Server and client implementation in .NET
  • βœ… Strongly-typed gRPC communication using Protocol Buffers
  • βœ… gRPC JSON transcoding

🧰 Technologies Used

  • .NET 9
  • gRPC
  • Protocol Buffers (.proto files)
  • JSON transcoding

πŸ—οΈ Project Structure

ToDoGrpc/ β”œβ”€β”€ ToDoGrpc.Server/ # gRPC service implementation β”œβ”€β”€ ToDoGrpc.Client/ # Console gRPC client to consume the service

πŸš€ Getting Started

Clone the repository

git clone https://github.com/qandeel-codes/dotnet-grpc-sample.git
cd dotnet-grpc-sample

Database setup

cd GrpcSample.Server
dotnet ef database update

Run the Server

dotnet run

Run the Client

In a new terminal:

cd GrpcSample.Client
dotnet run

You should see client-server communication in the terminal output.

πŸ“„ License

This project is open-source and available under the MIT License.

πŸ™Œ Acknowledgements

About

A simple and well-structured example demonstrating how to implement gRPC services in .NET, including server and client communication.

Topics

Resources

Stars

Watchers

Forks

Languages