44 practical guides
EF Core Guides for .NET
Start by configuring a DbContext and connecting to PostgreSQL. Then choose a reading path for the problem you are working on. Each path moves from the basic decisions to more specific implementation and troubleshooting guides.
Start here
EF Core and PostgreSQL: Getting Started Guide
PostgreSQL is a powerful open-source database with features like JSONB, arrays, and full-text search. Here is how to set it up with EF Core using the Npgsql provider.
Read the complete guide →Explore EF Core
Browse all .NET guides →Modeling
Configure relationships, value objects, keys, and database-specific column types.
- Configuring Entity Relationships in EF Core
7 min read
- Cascade Delete in EF Core: Behaviors and Pitfalls
7 min read
- Composite Primary Keys in EF Core
6 min read
- Identity vs Sequence vs HiLo Key Generation in EF Core
6 min read
- Value Conversions in EF Core Explained
6 min read
- Mapping Enums in EF Core: Strings, Ints, and Native Postgres Enums
6 min read
- Owned Types in EF Core for DDD Value Objects
6 min read
- Complex Types in EF Core 8: What You Need to Know
6 min read
- Table Per Hierarchy vs Table Per Type in EF Core
8 min read
- Mapping JSON Columns in EF Core
6 min read
- Computed Columns in EF Core
6 min read
- Shadow Properties in EF Core Explained
6 min read
- Modeling Hierarchical Data in EF Core
6 min read
- Custom Model Conventions in EF Core
5 min read
Querying
Understand tracking, load related data, and build paginated queries.
- Understanding the EF Core Change Tracker
6 min read
- Find vs FirstOrDefault in EF Core
7 min read
- EF Core Lazy Loading vs Eager Loading vs Explicit Loading
6 min read
- AsNoTracking vs AsNoTrackingWithIdentityResolution
7 min read
- Pagination in ASP.NET Core With EF Core
6 min read
- Fixing "The Instance of Entity Type Cannot Be Tracked" in EF Core
6 min read
- Repository Pattern in C# With Entity Framework Core
7 min read
- Unit of Work Pattern With EF Core
6 min read
Performance
Inspect generated SQL, fix expensive queries, and evaluate pooling and compiled models.
- EF Core Performance: Tips, Tricks, and Best Practices
6 min read
- How to Log SQL Queries Generated by EF Core
5 min read
- EF Core Query Performance: Avoid These Mistakes
6 min read
- N+1 Query Problem in EF Core and How to Fix It
6 min read
- DbContext Pooling in EF Core: When It Helps and When It Bites
6 min read
- EF Core Compiled Models for Faster Startup
7 min read
- EF Core vs Dapper: When to Use Each
5 min read
Migrations
Plan schema changes, automate deployments, and prepare for rollback.
- EF Core Migrations Best Practices in Production
7 min read
- Seeding Data in EF Core: Strategies and Best Practices
7 min read
- EF Core Migration Bundles for CI/CD Deployments
6 min read
- Zero-Downtime Database Migrations With EF Core
7 min read
- How to Roll Back an EF Core Migration
6 min read
- Fixing PendingModelChangesWarning in EF Core 9
6 min read
Production operations
Configure database access, handle retries and concurrency, and record data changes.
- EF Core and PostgreSQL: Getting Started Guide
6 min read
- EF Core DbContext: Configuration and Best Practices
6 min read
- How to Use EF Core With Multiple Databases
6 min read
- EF Core Connection Resiliency and Retry Logic
5 min read
- Fixing "Cannot Write DateTime with Kind=Local" With Npgsql
6 min read
- Optimistic Concurrency With Postgres xmin in EF Core
7 min read
- PostgreSQL Locking for .NET Developers: FOR UPDATE, SKIP LOCKED, and Advisory Locks
9 min read
- Audit Logging With EF Core Interceptors
7 min read
- Temporal Tables in EF Core for Data Auditing
6 min read