From the course: Azure Microservices with .NET Core for Developers

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Invoking the products microservice from search

Invoking the products microservice from search - Azure Tutorial

From the course: Azure Microservices with .NET Core for Developers

Start my 1-month free trial

Invoking the products microservice from search

- [Instructor] We already implemented the communication to the orders microservice. Let's go ahead and implement the communication to the products microservice. So the first thing that I want to do is to open the starter file because we need to configure the HttpClient object that we're going to use to communicate to the ProductsService. Let's execute HttpClient ProductsService. And let's set the BaseAddress property to the Configuration that we have inside the app settings JSON file. Great, now let's add a new model class inside the Models folder. This class will be named Product and this is quite different from the one that we have in the Products project because we only need the Id and the Name and that's it. We don't need anything else. Now let's add a new interface inside the Interfaces folder named IProductsService. Here I'm going to implement the GetProductsAsync method. This method will return a tuple with…

Contents