Entity Framework Core in Action
Entity Framework Core in Action
Summary:
Introduction
The book «Entity Framework Core in Action» by Jon Smith is one of the most comprehensive and practical guides to working with the popular ORM framework from Microsoft. Published in 2021 (second edition, covering EF Core 5), the 617-page book is intended for C# developers who want to master modern approaches to interacting with databases in the .NET ecosystem.
Jon Smith is a recognized expert on Entity Framework, author of numerous articles, and contributor to open-source projects. His writing style is characterized by clarity, attention to detail, and a focus on real-world scenarios. This review will help you understand whether it's worth investing time in studying this work and what practical benefits you will gain.
What is this book about?
The book covers the full lifecycle of working with Entity Framework Core: from initial setup and model creation to performance optimization and deployment in a production environment. The main focus is on EF Core 5, but many concepts are also applicable to newer versions.
The author systematically guides the reader through key topics:
- EF Core Basics: what an ORM is, how to configure a database context, connecting to various DBMS (SQL Server, PostgreSQL, SQLite).
- Data Model Creation: Code-First and Database-First approaches, fluent API, data annotations, one-to-many, many-to-many relationships, and inheritance.
- LINQ Queries: deep dive into syntax, filtering, projection, loading related data (Eager Loading, Explicit Loading, Lazy Loading).
- Migrations: managing database schema changes, creating and rolling back migrations, working with multiple environments.
- Performance: analyzing generated SQL queries, using AsNoTracking, batching, caching, connection pooling.
- Testing: unit testing using in-memory provider and SQLite, mock objects.
- Advanced Topics: working with stored procedures, raw SQL queries, global query filters, shadow properties, configuration for microservices.
Who is the book for?
The book is aimed at developers who already have basic experience with C# and .NET but want to deepen their knowledge of data access. It will be useful both for beginners just starting with EF Core and for experienced professionals migrating from Entity Framework 6.x or other ORMs (e.g., NHibernate).
The book is particularly valuable for:
- Backend developers on ASP.NET Core building web applications and APIs.
- Developers migrating projects from .NET Framework to .NET Core/.NET 5+.
- Those who want to understand the internal mechanisms of EF Core to optimize queries.
- Teams implementing continuous integration and testing practices.
What will the reader learn?
After reading the book, you will be able to:
- Set up EF Core in a project of any scale — from a console application to a microservice architecture.
- Properly design a data model using all the capabilities of fluent API and annotations.
- Write efficient LINQ queries, avoiding common mistakes that lead to performance degradation.
- Manage database migrations in a team, resolve conflicts, and apply migrations in production.
- Test code that works with a database without needing to deploy a real DBMS.
- Optimize performance: find bottlenecks using a profiler, use caching and batching.
- Work with non-trivial scenarios: inheritance, complex relationships, stored procedures.
Strengths of the book
The first thing that stands out is its practical focus. Each
Recommendations
JavaScript (Node.js) and Microservices: A Practical Guide
Machine Learning and Java: From Basics to Industrial Solutions
Concurrency in TypeScript: Asynchronous and Parallel Programming
Rust and Kubernetes: Reliable Cloud Application Development
C# (.NET): Tips and Best Practices
Rust Brain Teasers: Puzzles for Rust Programmers