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)

Entity Framework


If we are using a relational database, there is an impedance mismatch with the data and our domain classes, since the data is relational whereas our domain is composed of objects. The aim of using ORM is to eliminate (or hide) this mismatch so that we can totally ignore the persistence problems and instead focus on our code rather than trying to generate pesky SQL statements. Having said that, there are many valid cases to drop back to SQL statements, such as performance tuning cases or complex reports.

Entity Framework (EF) is the Object Relational Mapping (ORM) framework that enables developers to work on domain-specific objects directly for data access instead of working on database queries. This reduces a lot of the code complexity in the data access layer of the application.

Before discussing Entity Framework and its features, let us pause for a moment and think about the steps that we follow when we try to save some information to the database while using ADO.NET:

  1. Construct...