liveBook · Manning

Database

As explained in ASP.NET Core in Action, 3e

A database is an organized collection of data managed for storage, retrieval, and processing.

A database is an organized collection of data used for storage, retrieval, and processing. In common application development, relational databases store data in tables and columns, while application code works with mapped objects. section 12.1.1

Figure 12.1 EF Core maps .NET classes and objects to database concepts such as tables and rows.
CH12_F01_Lock3

The mapping connects .NET classes and objects with database tables and rows, making the relationship between application code and stored data concrete. section 12.1.1

Entity Framework Core acts as an object-relational mapper (ORM): it maps classes and objects to database concepts and maps database responses back to .NET objects. Its provider model supports relational systems such as SQL Server, SQLite, MySQL, and PostgreSQL, as well as an in-memory database for testing. It can also work with document databases such as Cosmos DB, although relational mapping is the main focus here. section 12.1.1

Production database work also requires attention to:

  • Restricting automatically scaffolded column types to sensible sizes. section 12.5
  • Validating entity values before saving, because EF Core does not validate them automatically. section 12.5
  • Handling concurrent updates, transient network failures, migrations, and synchronous or asynchronous database commands. section 12.5

A practical testing database

An application can use EF Core’s in-memory feature to create a temporary database while testing data-access behavior. section 12.1.1

How ASP.NET Core in Action, 3e covers it

How deep it goes
Defines relational mapping and surveys production concerns without detailing migration or concurrency implementations.
Examples
Uses SQL Server, SQLite, MySQL, PostgreSQL, Cosmos DB, and temporary in-memory databases as concrete technology examples.
What you can do after
Evaluate database options and understand how EF Core maps .NET classes to relational tables and rows.
How it connects
Connects relational databases with SQL, ORMs, Entity Framework Core, .NET objects, and database providers.

Also explained in

Compare how 24 books explain database →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ASP.NET Core in Action, 3e. The section links point to the parts of the book it draws on.