Skip to content

Commit 4b10c6c

Browse files
authored
Transcoder sample clean up (#1753)
1 parent e616db6 commit 4b10c6c

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

build/get-dotnet.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ $install_script_path -v 3.1.300 -i $dotnet_install_path
3333
# Install .NET 5 SDK to run 5.0 test targets
3434
$install_script_path -v 5.0.302 -i $dotnet_install_path
3535

36-
# Install .NET 7 SDK for transcoder sample
36+
# Install .NET 7 SDK for transcoder sample and trim analysis fixes
3737
$install_script_path -v 7.0.100-preview.5.22229.2 -i $dotnet_install_path
3838

3939
# Install .NET version specified by global.json

examples/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,14 @@ The gRPC-Web JavaScript client was generated from *greet.proto* using [`protoc`]
214214
* Configure ASP.NET Core server to enable gRPC-Web cross-origin requests (CORS)
215215
* Call gRPC services with JavaScript from a SPA
216216

217+
## [Transcoder](./Transcoder)
218+
219+
The transcoder shows how to use [gRPC JSON transcoding](https://docs.microsoft.com/aspnet/core/grpc/httpapi) to generate RESTful APIs from gRPC services.
220+
221+
##### Scenarios:
222+
223+
* gRPC JSON transcoding
224+
217225
## [Microservicer](./Microservicer)
218226

219227
The microservicer example shows how to use gRPC in a solution that contains multiple web apps. The backend app hosts a gRPC service that is called by the frontend app. The frontend app uses gRPC client factory to create a client an inject it into the MVC controller with dependency injection.

examples/Transcoder/Server/Server.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22

33
<PropertyGroup>
44
<TargetFramework>net7.0</TargetFramework>
5-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
6-
<NoWarn>1591</NoWarn>
75
</PropertyGroup>
86

97
<ItemGroup>
108
<Protobuf Include="..\Proto\greet.proto" GrpcServices="Server" Link="Protos\greet.proto" />
119

1210
<PackageReference Include="Grpc.AspNetCore" Version="$(GrpcDotNetPackageVersion)" />
13-
<PackageReference Include="Microsoft.AspNetCore.Grpc.JsonTranscoding" Version="7.0.0-preview.4.22219.9" />
11+
<PackageReference Include="Microsoft.AspNetCore.Grpc.JsonTranscoding" Version="7.0.0-preview.4.22251.1" />
1412
</ItemGroup>
1513

1614
</Project>

examples/Transcoder/Server/Startup.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ public class Startup
77
{
88
public void ConfigureServices(IServiceCollection services)
99
{
10-
services
11-
.AddGrpc()
12-
.AddJsonTranscoding();
10+
services.AddGrpc().AddJsonTranscoding();
1311
}
1412

1513
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

0 commit comments

Comments
 (0)