Book Image

ASP.NET Core 2 Fundamentals

By : Onur Gumus, Mugilan T. S. Ragupathi
Book Image

ASP.NET Core 2 Fundamentals

By: Onur Gumus, Mugilan T. S. Ragupathi

Overview of this book

The book sets the stage with an introduction to web applications and helps you build an understanding of the tried-and-true MVC architecture. You learn all about views, from what is the Razor view engine to tagging helpers. You gain insight into what models are, how to bind them, and how to migrate database using the correct model. As you get comfortable with the world of ASP.NET, you learn about validation and routing. You also learn the advanced concepts, such as designing Rest Buy (a RESTful shopping cart application), creating entities for it, and creating EF context and migrations. By the time you are done reading the book, you will be able to optimally use ASP.NET to develop, unit test, and deploy applications like a pro.
Table of Contents (14 chapters)

Adding the Registration Feature


Since we will start adding logic to our application, this is a good time to add our application layer to the project. As we discussed in the previous chapter, we are designing our application to be layered and abiding by domain-driven design standards.

In domain-driven design, a common approach in layering is Onion Architecture. In onion architecture, each layer can make use of the inside layer but the outside layer has to adapt itself to the inside. And we try to design our application from inside out. That's why we have designed our application starting with entities:

In the preceding figure, we have a domain model at the core, and on top of it we have application services. The purple rectangles are interfaces, the black arrows denote compile-time dependencies, and the magenta circles are external dependencies on infrastructure.

Application Services are for handling commands and requests.

Note

There is an on-going discussion on whether entities in the domain...