- Configure entities in `IEntityTypeConfiguration<T>` classes, not in `OnModelCreating()` — keep DbContext clean and organized.
- Use `AsNoTracking()` for read-only queries — it skips change tracking and is significantly faster for SELECT operations.
- Use `Include()` and `ThenInclude()` for eager loading related entities — avoid N+1 queries by loading navigation properties upfront.
- Use `.Include()` and `.ThenInclude()` for eager loading. Avoid lazy loading — it causes N+1 queries.
- Use `AsNoTracking()` for read-only queries to reduce memory and improve performance.
- Use `SaveChangesAsync()` — the change tracker batches all modifications into a single transaction.
- Configure indexes, unique constraints, and relationships in `OnModelCreating()` using Fluent API.