Summary
In this chapter, we created a Web API using ASP.NET Core minimal APIs. We covered creating services and an in-memory repository, configured them with the dependency injection container, created models, and used game analyzer classes to calculate moves.
We created endpoints to create, read, and update games, specified information to show up with the OpenAPI documentation, tested the service using HTTP files, and finally, added .NET Aspire for hosting and a dashboard.
After working through this chapter, you deserve a break to play a game. Use the HTTP files to create a game and set moves until the answer returned shows that you won. Don’t cheat by making GET
requests to the game before you find the answer!
In the next chapter, we’ll replace the repository by using Entity Framework Core with SQL Server and Azure Cosmos DB to have a persistent games store.