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?
The Entity Framework is a set of technologies in ADO.NET that support the development of data-oriented software applications.
EF is built on top of ADO.Net, meaning that you can use both at the same time.
Entity Framework is an object-relational mapping (ORM) framework for connecting C# code to external databases, usually SQL Server. LINQ is a query language embedded into C# and a set of extension methods in order to make it useful.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With