/WebApiProtobufFormatter

dotnet core webapi protobuf formatter

Primary LanguageC#Apache License 2.0Apache-2.0

WebApiProtobufFormatter

注意

此项目目前尚未稳定,请勿用于生产环境。

使用

安装 Grpc.Tools

配置

<Project>
  <ItemGroup>
    <Protobuf Include="Models\Proto\*.proto" />
  </ItemGroup>
</Project>

Startup.cs

services.AddControllers().AddProtobufFormatters();

services.AddMvcCore().AddProtobufFormatters();

services.AddControllersWithViews().AddProtobufFormatters(new ProtobufFormatterOptions(), options => { });

打包

dotnet pack -p:PackageVersion=x.x.x --configuration Release --include-source