Infrastructure
Let’s create a bare foundation of what’s needed for having observers that can respond to events being appended.
Let’s create a folder called Chapter12 at the root of your repository. Change into this folder in your command-line interface and create a new console project:
dotnet new console
You’re going to make use of the Microsoft hosting model to get the .NET default service provider without spinning up a web application. To achieve this, you’ll need the package called Microsoft.Extensions.Hosting. In the terminal, you’d add the reference by doing the following:
dotnet add package Microsoft.Extensions.Hosting
The next thing you’ll need to do is to reference the Fundamentals project. In the terminal, do the following:
dotnet add reference ../Fundamentals/Fundamentals.csproj
As I discussed in Chapter 4, Reasoning about Types Using Reflection, one of the things I do in all my code is to formalize types...