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
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























