Service invocation with the .NET SDK
The best approach to understand how the Dapr .NET SDK supports service-to-service invocation is to thoroughly examine a sample project.
These are the steps that we will follow:
- Create a project for the Order service.
- Configure Dapr in ASP.NET.
- Implement Dapr with an ASP.NET controller.
- Create a project for the Reservation service.
- Prepare debugging configuration.
- Implement Dapr with ASP.NET routing.
We will start by creating a project for the first Dapr application in our solution.
Creating a project for the Order service
When creating the project for a Dapr service, we start from the webapi
template:
PS C:\Repos\dapr-samples> cd .\chapter03\ PS C:\Repos\dapr-samples\chapter03> dotnet new webapi -o sample.microservice.order The template "ASP.NET Core Web API" was created successfully. Processing post-creation actions... Running 'dotnet restore' on sample.microservice.order...