Client - coding it down

We will create a web client for consuming our newly deployed reactive microservice with the help of AutoRest. Let's create a console application for it and add Nuget packages: Reactive.Core, WebApi.Client, Microsoft.Rest.ClientRuntimeand Newtonsoft.Json.

  1. AutoRest would add a folder named Models to the main project and create copies of the model's product and category, as in the service that we just created. It will have necessary deserialization support built into in.
  2. ProductOperations.cs and ProductServiceClient.cs contain the main plumbing required for all the calling.
  3. In the Main function of the Program.cs file, change the Main function as follows:
        static void Main(string[] args)        { var client = new ProductServiceClient ...

Get Building Microservices with .NET Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.