Skip to content

majidbigdeli/protobuf-net.Grpc

This branch is 52 commits behind protobuf-net/protobuf-net.Grpc:main.

Folders and files

NameName
Last commit message
Last commit date
Oct 13, 2019
Jul 5, 2021
Mar 19, 2021
Jun 28, 2021
Mar 19, 2021
Nov 14, 2020
Jun 16, 2019
Jul 5, 2020
Nov 16, 2020
Apr 21, 2021
Apr 5, 2020
Mar 19, 2021
Jun 16, 2019
Nov 14, 2020
Mar 1, 2020
Jul 5, 2020
Mar 19, 2021
Mar 19, 2021
Jul 5, 2020
Jun 23, 2020

Repository files navigation

protobuf-net logo protobuf-net.Grpc

Build status

protobuf-net.Grpc adds code-first support for services over gRPC using either the native Grpc.Core API, or the fully-managed Grpc.Net.Client / Grpc.AspNetCore.Server API.

It should work on all .NET languages that can generate something even remotely like a regular .NET type model.

Usage is as simple as declaring an interface for your service-contract:

[ServiceContract]
public interface IMyAmazingService {
    ValueTask<SearchResponse> SearchAsync(SearchRequest request);
    // ...
}

then either implementing that interface for a server:

public class MyServer : IMyAmazingService {
    // ...
}

or asking the system for a client:

var client = http.CreateGrpcService<IMyAmazingService>();
var results = await client.SearchAsync(request);

This would be equivalent to the service in .proto:

service MyAmazingService {
    rpc Search (SearchRequest) returns (SearchResponse) {}
	// ...
}

Obviously you need to tell it the uri etc - see Getting Started. Usually the configuration is convention-based, but if you prefer: there are various configuration options.

Getting hold of it

Everything is available as pre-built packages on nuget; in particular, you probably want one of:

Usage examples are available in C#, VB and F#.

Anything else?

protobuf-net.Grpc is created and maintained by Marc Gravell (@marcgravell), the author of protobuf-net.

It makes use of tools from grpc, but is not official associated with, affiliated with, or endorsed by that project.

I look forward to your feedback, and if this could save you a ton of time, you're always welcome to Buy me a coffee

About

GRPC bindings for protobuf-net and grpc-dotnet

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%