Reply to post: Re: Entity Framework is an abomination and shouldn't even exist

Why Microsoft's .NET Core is the future of its development platform

d3vy

Re: Entity Framework is an abomination and shouldn't even exist

+1 for Steve.

I have been a .net developer for 12 years now... I can count on one hand the number of times that we have been given time by the business to "do things right".

Given the choice of taking a performance hit when reading and writing to the db and use ef or waste a week writing stored procedures to read, write, update from each and every table in the database... I know what I'd choose... That's a week I can spend making sure the rest of the app works.

If the sql is sub optimal and it affects the app then yeah, maybe that ef query needs tweaked... At an extreme it needs replaced with a sproc, but the majority of stuff... Select * from users where name = 'fajita hertz' ... Let ef do that.

The other bonus with a norm of course is schema changes, new table? One new class in the model, one line in the context, ready to be used. (Probably some dto mappings too).

Straight ado? Well that's a new class (same one probably), then a sproc to select and a method in the dal, a proc to delete and method in the dal, and an insert/update proc and method in the dal... Then the same dto mappings etc..

I've been places where the DBAs ban the use of ef because it's slow and the sql is crap but the apps are riddled with inline sql, there are no indexes on the data, and what procs do exist are worse than ef would produce...

I know not everyone likes ORMs but if you ask me the benefits out weigh the downsides.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon