I recently read and implemented the code for the book “The Little ASP.NET Core Book” from Nate Barbettini. It is a short book with a very well defined objective: To create a functional application from the ground up and no extra helpers (Visual Studio, Scaffolding, etc).
The book starts by giving an introduction on what is ASP.NET Core, its benefits and why to use it. It then proceeds to the creation of an application (Todo-list) based on the dotnet core MVC Template.
The reader will be introduced to the basics of the MVC pattern, will be guided on the process of creating Models, Views, and Controllers using the Repository design pattern and Dependency Injection. At this point the reader will be introduced to the repository pattern, the author guides us to develop a Service interface so we can get our data from different data-sources by just adapting the Dependency Injection section.
The book also tips on how to add useful packages through NuGet, like packages to enhance date displaying formats.
Entity Framework Core is used as the ORM, SQLite is the chosen database system. As readers, we are instructed on how to establish a connection (using connection strings) and configure context and service classes to use it.
The controllers have their responsibilities well defined and are kept clean. Mainly only interacting with the services layer to execute actions, configuring the responses and passing the ViewModels to the Pages.
User identity and security are also addressed. The project is created using –auth Individual option which adds basic user individual authentication to the project. Controllers are protected through the use of the Authorize attribute. Role-based authentication is added later in the book and is used to allow specific users to access management sections of the application.
Finally, there is a brief section on how to implement unit and integration tests to the solution and how to deploy it.
Due to its short amount of pages and the well-guided process to develop an entire (although small) application without using scaffolding this book is a great resource to better understand the entire process of ASP.NET Core app development. It will take just a few hours to read and implement everything but certainly can clarify some principles of ASP.NET Core development.
My implementation for the books code can be found on my Github.