Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What problems have you had with Entity Framework?

We have used Entity Framework on 2 projects both with several 100 tables.

Our experiance is mainly positive. We have had large productivity gains, compare with using Enterprise Library and stored procedures.

However, when I suggest using EF on stackoverflow, I often get negative comments.

On the negative side we have found that there is a steep learning curve for certain functionality.

Finally, to the question: What problems have people had with EF, why do they prefer other ORMS?

like image 604
Shiraz Bhaiji Avatar asked Jul 20 '09 17:07

Shiraz Bhaiji


People also ask

Why you should not use Entity Framework?

One of the biggest reasons not to use Entity Framework Core is that your application needs the fastest possible data access. Some applications do a lot of heavy data operations with very high-performance demands, but usually business applications don't have that high of a performance demand.

What can you do with Entity Framework?

The Entity Framework enables developers to work with data in the form of domain-specific objects and properties, such as customers and customer addresses, without having to concern themselves with the underlying database tables and columns where this data is stored.


3 Answers

Like you, my experience with the EF is mostly positive. The biggest problem I've had is that very complex queries can take a long time to compile. The visual designer is also much less stable and has fewer features than the framework itself. I wish the framework would put the GeneratedCode attribute on code it generates.

like image 184
Craig Stuntz Avatar answered Sep 29 '22 20:09

Craig Stuntz


I recently used EF and had a relatively good experience with it. I too see a lot of negative feedback around EF, which I think is unfortunate considering all that it offers.

One issue that surprised me was the performance difference between two strategies of fetching data. Initially, I figured that doing eager loading would be more efficient since it would pull the data via a single query. In this case, the data was an order and I was doing an eager load on 5-8 related tables. During development, we found this query to be unreasonably slow. Using SQL profiler, we watched the traffic and analyzed the resulting queries. The generated SQL statement was huge and SQL Server didn't seem to like it all that much.

To work around the issue, I reverted to a lazy-loading / on-demand mode, which resulted in more queries to the server, but a significant boost in performance. This was not what I initially expected. My take-away, which IMHO holds true for all data access implementations, is that I really need to perf test the data access. This is true regardless of whether I use an ORM or SQL procs or parameterized SQL, etc.

like image 36
NathanAW Avatar answered Sep 29 '22 22:09

NathanAW


I use Entity Framework too and have found the following disadvantages:

  1. I can't work with Oracle that is really necessary for me.
  2. Model Designer for Entity Framework. During update model from database storage part is regenerated too. It is very uncomfortably.
like image 21
Ramesh Avatar answered Sep 29 '22 20:09

Ramesh