Implementing actors in an e-commerce reservation system
Equipped with information about the Actor's pattern and with a plan to implement the evolution of our sample project by introducing Dapr actors, we now have several steps to complete, as follows:
- Create the Actor's projects.
- Implement the actor's model.
- Access actors from other Dapr applications.
- Inspect the Actor's state.
Let's start by creating the .NET projects.
Preparing the Actor's projects
To implement Actors with Dapr in C#, we must create an actor interface project that's separate from the actor's service implementation in two different projects.
The actor's interface will be referenced by the other services or clients that need to interact with the actors. Let's create the interface project, as follows:
PS C:\Repos\dapr-samples\chapter07> dotnet new classlib -f net5.0 -o sample.microservice.reservationitemactor.interfaces PS C...