You’re All Doing Entity Framework Wrong
Michael Hoagland
1.8K35

There really isn’t a way to use Entity Framework correctly since it’s simply garbage. It’s a masterpiece of Microsoft showing off all of the “cool” stuff you can do with reflection and LINQ. The coolness draws you in and then once you’re committed to it, you realize you’ve built your enterprise application on something that is slow and doesn’t scale very well. When I hear about disasters like HealthCare.gov and wait in lines at places waiting for the computer to catch up, all I can think is that some developer decided to use a tool that they heard about.

I use EF daily and find that it works fine for simple CRUD operation. If I need to retrieve large quantities of data that involve a lot of different relationships, I will write my own SQL. It’s not just a little faster. It’s hundreds of times faster. The queries are also much easier to decipher than the LINQ. If you want to use EF, use a hybrid approach. There’s no benefit to going all in with EF.