Entity Framework 4.0: is it worthy now?

I've read a lot complains about Entity Framework in .NET 3.5 SP1, especially about its ineffectively generated SQL. Those complains had prevented me from studying Entity Framework.

Now Entity Framework 4.0 has come out, which provide a lot of promises. I wonder if it's really a good ORM now, or still not yet? Is it worth to learn and use it in my .NET projects, instead of traditional SQL queries? Have you planned to switch to EF 4.0 yet?

Thanks in advance.


One word: YES!!

Entity Framework 4.0 contains a huge number of additions and improvements, and with the additional templates for POCO's and self-tracking entities, it's definitely ready for prime time now.

If you want to, you can even go so far as to define your entire EF "model" in code - no *.edmx file at all - looks and feels a lot like Fluent NHibernate. You have lots of options with EF4 - and that's a good thing, and a sign that the ADO.NET team really did listen to the community (and work very hard to make those things a lot better now).

In addition to Julie Lerman's book and blog, you should also check out the ADO.NET EF4 team blog - it contains very useful and helpful hints and tips.

This blog post in particular might be of interest to you:

  • Improvements to generated SQL in Entity Framework 4

  • You should really check out Julie Lerman's blog on EF4, she's at once enthusiastic on the product, yet technically correct. As per me, I can tell you that we have already used EF4 in more than a couple production projects with good results :-)


    Yes , EFv4 (in .net 4) is in a completely different league than EFv1 (in .net 3.5 SP1).

    EFv1 had a lot of limitations and it sometimes generated horrible T-SQL.

    The TSQL generated by EFv4 is fine as far as I am concerned; sometimes it has a bit more nesting with subqueries than needed but that is a cosmetic thing that only affects human readability...

    链接地址: http://www.djcxy.com/p/33502.html

    上一篇: 通过实体或LINQ处理SQL数据?

    下一篇: 实体框架4.0:现在值得吗?