You’re All Doing Entity Framework Wrong
Michael Hoagland
44821

One thing I always do that I wish EF did by default when reverse-engineering classes from a database is to put the fluent config into EntityTypeConfiguration<T> classes rather than as a massive wall of code in OnModelCreating(). I’ve seen OnModelCreating() methods that were over a thousand lines long; I’d much rather have it all separated neatly by entity, in a namespace/folder, and then use modelBuilder.Configurations.Add() or .AddFromAssembly() to pull them all in.

Like what you read? Give Nicholas Budd a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.