Data Annotations or Fluent API in EF Core? OnModelCreating and IEntityTypeConfiguration
We put the two ways of overriding conventions side by side: data annotations and the Fluent API in OnModelCreating. We split configuration with IEntityTypeConfiguration and ApplyConfigurationsFromAssembly, test unique indexes, check constraints and default values against real SQLite errors, and see the precedence order and the bool default trap.
5 Nov 2026
·
9 min
·
3