LinKit.Grpc 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package LinKit.Grpc --version 1.0.0
                    
NuGet\Install-Package LinKit.Grpc -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LinKit.Grpc" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LinKit.Grpc" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="LinKit.Grpc" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LinKit.Grpc --version 1.0.0
                    
#r "nuget: LinKit.Grpc, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LinKit.Grpc@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LinKit.Grpc&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=LinKit.Grpc&version=1.0.0
                    
Install as a Cake Tool

LinKit.Grpc

LinKit.Grpc extends LinKit.Core to provide automatic gRPC server and client code generation based on your CQRS requests and handlers.

Features

  • gRPC Server:
    • Generate gRPC service implementations from CQRS requests marked with [GrpcEndpoint].
    • No manual mapping or boilerplate needed.
  • gRPC Client:
    • Generate mediator-based gRPC clients for remote CQRS requests.
    • Seamless integration with LinKit mediator pattern.
  • Automatic Mapping:
    • Properties are mapped by name or via [JsonPropertyName]/mapping configuration.
  • AOT & Trimming Ready:
    • Fully compatible with NativeAOT and trimming.

Installation

dotnet add package LinKit.Grpc

Quick Start

1. gRPC Server

Mark your CQRS request:

[GrpcEndpoint(typeof(MyServiceBase), "GetUser")]
public class GetUserQuery : IQuery<UserDto>
{
    public int Id { get; set; }
}

Implement handler:

[CqrsHandler]
public class GetUserHandler : IQueryHandler<GetUserQuery, UserDto> { ... }

Register gRPC server:

builder.Services.AddLinKitGrpcServer();
app.MapGrpcService<LinKitMyService>();

2. gRPC Client

Mark your CQRS request:

[GrpcClient(typeof(MyServiceClient), "GetUserAsync")]
public class GetUserQuery : IQuery<UserDto>
{
    public int Id { get; set; }
}

Register gRPC client:

builder.Services.AddLinKitGrpcClient();
builder.Services.AddSingleton<IGrpcChannelProvider, MyChannelProvider>();

Send request via mediator:

var result = await mediator.QueryAsync(new GetUserQuery { Id = 1 });

3. Channel Provider Example

public class MyChannelProvider : IGrpcChannelProvider
{
    public GrpcChannel GetChannel(Type serviceClientType)
        => GrpcChannel.ForAddress("https://localhost:5001");
}

Configuration

  • Use [GrpcEndpoint] on CQRS requests to expose them as gRPC server methods.
  • Use [GrpcClient] to generate gRPC client calls for remote services.
  • All mapping between CQRS requests/responses and gRPC messages is automatic.
  • For custom mapping, use the Mapping Kit from LinKit.Core.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4 0 9/27/2025
1.0.3 51 9/26/2025
1.0.2 73 9/26/2025
1.0.1 81 9/26/2025
1.0.0 107 9/5/2025