Click here to Skip to main content
15,885,754 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
My seniors are suggesting me for using ado.net instead of entity framework.

What I have tried:

Why ado.net instead of entity framework
Posted
Updated 31-Mar-21 17:16pm
Comments
Dave Kreskowiak 28-May-18 16:49pm    
How about asking them?

1 solution

These are nested block. Entity Framework is build on top of ADO.NET.
ADO.NET handles raw Sql connection and Sql query between your app and a database.

Entity Framework is a much higher level framework. Internally it creates and run query with ADO.NET, but it present an object model of the database and support LINQ (C#) query.

while it is much nicer to use and less error prone it suffer from a few shortfalls. mostly performance. Not really because EF has bad performance, but because:

1. it is extremely easy to write very inefficient SQL query using C#. And it is a common issue with junior developers. BTW this is easy to fix with a bit of investigation with LinqPad, for each query.
2. it very easy to inadvertently write a few lines which unexpectedly make a lot of database query. Easy to fix with proper DatabaseContext configuration (I personally think the default configuration of DB context is a source of endless such problem)

I suspect your senior want to use ADO.NET for either of 2 reason;
- they don't understand Entity Framework and they are worry because they heard of performance issues
- they know both well, but they are worry about their team ability to work with EF well
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900