StackSpot.Grpc 1.0.1

dotnet add package StackSpot.Grpc --version 1.0.1                
NuGet\Install-Package StackSpot.Grpc -Version 1.0.1                
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="StackSpot.Grpc" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add StackSpot.Grpc --version 1.0.1                
#r "nuget: StackSpot.Grpc, 1.0.1"                
#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.
// Install StackSpot.Grpc as a Cake Addin
#addin nuget:?package=StackSpot.Grpc&version=1.0.1

// Install StackSpot.Grpc as a Cake Tool
#tool nuget:?package=StackSpot.Grpc&version=1.0.1                

StackSpot Grpc .NET Core

Componente foi projetado para padronizar a configuração do gRPC nas aplicações.

Versões .NET suportadas

Atualmente, este projeto oferece suporte a aplicativos destinados net5.0.

Uso

1. Adicione o pacote NuGet StackSpot.Grpc ao seu projeto.
dotnet add package StackSpot.Grpc
2. Adicione ao seu IServiceCollection via services.AddGrpcServer() no Startup da aplicação ou Program.
services.AddGrpcServer();
3. Adicione ao seu IApplicationBuilder via app.UseGrpc() no Startup da aplicação ou Program.

Para facilitar o registro dos serviços gRPC descritos nos arquivos proto, fornecemos um método de extensão chamado MapGrpcServices para IEndpointRouteBuilder que realiza o registro de todos os serviços gRPC de um assembly. Ele pode ser chamado diretamente ou conforme exemplo abaixo:

 app.UseGrpc(env, typeof(Startup).Assembly, Path.Combine(env.ContentRootPath, "Protos"))

Caso queira habilitar um endpoint /proto para servir os arquivos proto do projeto inclua a configuração abaixo:

public void Configure(IApplicationBuilder app)
{
    ...
    app.UseGrpcDirectoryBrownser(Path.Combine(HostEnviroment.ContentRootPath, "Protos"));
    ...
}
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
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.1 1,121 4/18/2022
1.0.0 435 4/12/2022