Service invocation with the .NET SDK
The best approach to understanding 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 an ASP.NET Minimal API.
We will start by creating a project for the first Dapr application in our solution.
Creating a project for the Order service
When creating a project for a Dapr service, we start from the webapi
template:
PS C:\Repos\practical-dapr> cd .\chapter04\ PS C:\Repos\practical-dapr\chapter04> 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...