Reputation: 679
Can someone please explain the difference between ADO.NET and Entity Framework in layman's terms?
I have searched from Google but can't understand the difference.
ADO.Net means using sqlConnection();
, sqlCommand();
etc. to interact with database using queries?
Entity Framework means using db.Add();
, db.SaveChanges();
functions to interact with database without using queries? Am I right?
Upvotes: 7
Views: 6710
Reputation: 711
When you use EF db.Add();
or db.SaveChanges
or any other integrated EF method, the ORM (object-relational mapper), in this example EF, will use ADO.NET (so EF will open database connection using ADO.NET, EF will create "SQL query" using ADO.NET,...).
Of course, you can do this all by yourself, using ADO.NET methods, which sometimes can increase the performance of the queries, but usually needs more code writing.
But in general, when you use EF, you also use ADO.NET, only its implemented inside EF methods.
Upvotes: 9