Skip to content

Instantly share code, notes, and snippets.

@gistlyn gistlyn/Configure.Grpc.cs

Last active May 17, 2020
Embed
What would you like to do?
Configure gRPC (requires .NET Core 3.1)
dotnet add package ServiceStack.Extensions
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using ServiceStack;
namespace MyApp
{
[Priority(-1)]
public class ConfigureGrpc : IConfigureServices, IConfigureApp, IConfigureAppHost
{
public void Configure(IServiceCollection services)
{
services.AddServiceStackGrpc();
}
public void Configure(IApplicationBuilder app)
{
app.UseRouting();
}
public void Configure(IAppHost appHost)
{
appHost.Plugins.Add(new GrpcFeature(appHost.GetApp()));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.