An open API service indexing awesome lists of open source software.

https://github.com/j0rgeserran0/netcoreconf_2021

Demos of the talk I did in the Virtual NetCoreConf 2021 in Spain
https://github.com/j0rgeserran0/netcoreconf_2021

2021 bidirectional-streaming-rpc client-streaming-rpc csharp grpc net5 netcore3 netcoreconf protobuf server-streaming-rpc talk unary-rpc

Last synced: 3 months ago
JSON representation

Demos of the talk I did in the Virtual NetCoreConf 2021 in Spain

Awesome Lists containing this project

README

          

![Logo](resources/images/logo.png)

> Demos of the talk I did in the Virtual **[NetCoreConf 2021](https://netcoreconf.com/)** in Spain (26th - 27th of February)

# **gRPC - Introducción a desarrolladores ASP.NET Core**

## **Presentation (pdf in Spanish)**

[NetCoreConf 2021 - Presentation](presentation.pdf)

## **Samples**

### **[GrpcHelloWorld](src/GrpcHelloWorld)**

> Typical gRPC *Hello World* sample that is shown in the talk (using **Unary**)
```
Client => .NET Core 3.1
Server => .NET 5
```

[protobuf file](src/GrpcHelloWorld/GrpcHelloWorldService/Protos/greet.proto)

**Startup.cs**

Important parts in the sample:

```csharp
public void ConfigureServices(IServiceCollection services)
{
services.AddGrpc();
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// MORE CODE HERE

app.UseStaticFiles();
app.UseRouting();

app.UseEndpoints(endpoints =>
{
endpoints.MapGrpcService();

// MORE CODE HERE
});
}
```

### **[GrpcDemo](src/GrpcDemo)**
> gRPC sample that is shown in the talk (using **Unary, Server Streaming, Client Streaming, Bidirectional Streaming**)
```
Client => .NET 5
Server => .NET 5
```

[protobuf file](src/GrpcDemo/GrpcDemoService/Protos/store.proto)

**Startup.cs**

Important parts in the sample:

```csharp
public void ConfigureServices(IServiceCollection services)
{
services.AddGrpc();
services.AddSingleton();
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// MORE CODE HERE

app.UseRouting();

app.UseEndpoints(endpoints =>
{
endpoints.MapGrpcService();

// MORE CODE HERE
});
}
```