I use visual studio 2005 , but recently I've heard that there is a new technology which called entity framework
.. should I move on and use it instead of using the usual SqlDataReader
!!
the most important thing to me is the performance , note that I get the data from the DB using DataReader and return it as a generic List ..
any suggestion .. thanx :)
views:
333answers:
6If you want to switch to Linq to Entities then yes, you will need VS2010.
Or you can stay with VS2005/2008 and use nHibernate or similar framework.
But none of those ORM tools is (primarily) about speed, so it may not be the right thing for you.
The reasons for switching to an ORM framework would be to use a more OOP approach, ie to replace your generic list.
Look through a few demos/walkthroughs to decide if it is something for you.
Writing the queries yourself still beats any automatic process performance-wise. Entity framework makes the data layer more abstract, which improves portability and readability.
The SqlDataReader
and the Entity Framework
are two completely different approaches to access your data. With SqlCommand
s, you yourself write the SQL queries. With an O/R mapping technology such as the Entity Framework
, the relational database structure is mapped to objects whose properties you access, e.g. Linq to Entities. Note that the O/R mapping approach is not about speed.
If you are in VS 2005
. I think you can't use Entity FrameWork. For that you required 2008 and .NET 3.5 SP1. Entity Framework has some issues. If you are going with Entity Framework; go with Visual Studio 2010 and .NET 4.0. This will be a better option.
Latest update from Scott Gu
The performance of Entity Framework isn't great compared to other O/RM tools (such as LINQ to SQL), but things have improved a lot with .NET 4.0. However, nobody here can tell you whether Entity Framework is fast enough for what you need. You will have to test this yourself.
I'd recommend to write up your requirements, then identify the options, evaluate each option with some tests that are meaningful for your requirements (e.g. ease of use, speed, etc.), and finally decide. With some smart design and implementation choices you might even be able to switch between some of them with relatively limited effort at least at the beginning.
The Entity Framework is certainly an option. I'd recommend to also include NHibernate and in particular fluent-nhibernate in your investigation. Good luck!