EF is so widely used staff but I don't realize how I should use it. I met a lot of issues with ef on different projects with different approaches. So some questions brought together in my head. And answers leads me to use pure ado.net with stored procedures. So the questions are:
Should I use one context per app\thread\atomic operation? Using approach - one context per app\thread may slightly increase performance and possibilities to call navigation properties, but we meet another problem - updating this context and growing loaded data in context, also I'm not sure about concurrency with one dbcontext per app\thread. Using context per operation will lead us to remapping ef results to our DTO's. So you see that we again pushed back to question no.1.
Could we try to use EF + SP's only? Again we have issues from previous questions. What is the reason to use ef if the biggest part of functionality will not be used?
So, yes EF is great to start project. It so convenient when we have few screens and crud operations. But what next?
All this text is just unsorted thoughts. I know that pure ado.net will lead to another kind of challenges. So, what is your opinion about this topic?
By following the naming conventions , you will find it's called : ADO.NET Entity Framework , which means that Entity Framework sits on top of ADO.NET so it can't be faster , It may perform both in equal time , but let's look at EF provides :
Finally : EF and LINQ give a lot of power in maintaining your applications later .
There are three different models with the Entity Framework : Model First , Database First and Code First get to know each of 'em .
-The Point about killing performance when remapping is on process , it's because that on the first run , EF loads metadata into memory and that takes time as it builds in-memory representation of model from edmx file.
ADO.NET provides consistent access to data sources such as SQL Server and XML, and to data sources exposed through OLE DB and ODBC. Data-sharing consumer applications can use ADO.NET to connect to these data sources and retrieve, handle, and update the data that they contain.
Entity Framework 6 (EF6) is a tried and tested object-relational mapper (O/RM) for .NET with many years of feature development and stabilization. An ORM like EF has the following advantage
ORM lets developers focus on the business logic of the application thereby facilitating huge reduction in code.
It eliminates the need for repetitive SQL code and provides many benefits to development speed.
Prevents writing manual SQL queries; & many more..
Here is a related thread on a similar topic: What is the difference between an orm and ADO.net?