LINQ to Entities v/s ADO.Net

ado.net, c#, linq

Solution

Since you said in your comment that you mean LINQ to Entities, I will answer thus:

LINQ to Entities internally use ADO.Net, so it would be impossible for LINQ to Entities to replace ADO.Net, because it uses it. However I am assuming that you mean to ask if you can use LINQ to Entities in every situation that you could use ADO.Net. The answer is no, you cannot.

There are cases that you would not want to (or could not) use LINQ to Entities. For example if you are in a certain situation where you need better performance for a query, it would be better to use a stored procedure. Generally LINQ to Entities is a better choice when developer productivity has a higher priority than the execution speed of queries. Other cases where LINQ to Entities is not a good choice is when a DB has been poorly designed and does not have a primary key for example.

But the main point I think is this: What has higher priority in your situation? Developer productivity or performance? It is also quite acceptable I think to use both technologies. Complete the project with LINQ to Entities, and if there are performance issues, use stored procedures or ADO.Net.

Also, I would not use LINQ to Entities for large queries, or queries that have many joins, LINQ syntax for joins is not very terse, and may hurt the readability of your code.

Problem

Can LINQ to Entities entirely replace ADO.Net technology? What I really want to know is, Is it possible to achieve every features and functionality that ADO.Net provides by using LINQ ? Who is the Boss?

Original source