Question: I am using .NET Core 3.1 and want to create a GRPC Service with a Console App as the Server and a WPF App as the Client.

I can't see any examples online - for some reason all the Console Apps seem to connect and send messages, none are Servers.

Is it possible to have a Console App starting the Service and a WPF App connecting and sending a message to it?

I have downloaded below project and am trying to see if I can get a Console App to be the Server.
[GRPC in .NET Core][1]

Any pointers appreciated.
[1]: <https://www.jenx.si/2019/06/14/experimenting-with-grpc-in-net-core/>

The Console App below is now the Server but I am not able to read and store the Payload from the Client in the Main function - I can see it is received in from the Client.

How can I store the payload message from the client in the Main function?

```
//Console App Main function listening for

static async Task Main(string[] args)
{
        _gRpcServer = new Server
        {
            Services ={Jenx.Grpc.SimpleDemo.Contracts.JenxSimpleGrpcService.BindService(new ConsoleAppGrpcClient())},
            Ports = {new ServerPort("localhost", 505050, ServerCredentials.Insecure)}
        };
}

//receives Client Message successfully
public override Task<ReplyMessage> SendMessage(RequestMessage request, ServerCallContext context)
    {
        Console.WriteLine($"Message Received: {request.RequestPayload}");
        Console.WriteLine("Sending message back to the client...");

//<<---need to Store below in variable and return to Main function above--->>
        return Task.FromResult(new ReplyMessage { ResponsePayload = $"ServerSideTime is {DateTime.Now}" });
    }

```

Answer: 
You should look at the [Helloworld example](https://github.com/grpc/grpc/tree/master/examples/csharp/Helloworld) in the [gRPC GitHub repository](https://github.com/grpc/grpc).
It contains a simple gRPC service where both the [server part](https://github.com/grpc/grpc/tree/master/examples/csharp/Helloworld/GreeterServer) and the client part are
C# console applications. Uses .NET SDK Core 2.1, but should work in .NET Core 3.1+
and .NET 5+ (I didn't try it on those versions).
To store the message received from the client, you can add a received notification handler and within the handler, you could add your process for storing the received messages. Utilizing the MediatR framework