Dump Linq-To-Sql now that Entity Framework 4.0 has been released?

后端 未结 2 920
野性不改
野性不改 2020-12-06 01:07

The relative simplicity of Linq-To-Sql as well as all the criticism leveled at version 1 of Entity Framework (especially, the vote of no confidence) convinced me to go with

2条回答
  •  没有蜡笔的小新
    2020-12-06 01:21

    Well, an endless debate :-)

    Yes, I firmly believe EF4 is definitely ready for prime time - Microsoft has done an outstanding job of addressing just about all the annoyances and issues with the 1.0 release of EF.

    It's ready for prime time - if you need all its features.

    Linq-to-SQL is a pretty straightforward, no-frills, no-nonsense OR mapper - it maps one database table to one CLR object - and that's about it. Very basic, very direct - but a rather thin layer on top of SQL Server.

    EF4 on the other hand is much more

    • a conceptual data model in your object space
    • a storage data model on your database layer
    • a mapping layer between the two
    • database-independent

    So if you really need support for multiple databases (and not just SQL Server), or if you really need to be able to morph the database structure into a totally different object model - EF4 is a great place to start.

    If you have a simple and straightforward little to medium-size app that only needs to be able to easily and quickly map tables 1:1 to objects, then I don't think EF4 comes even close in terms of simplicity and performance to Linq-to-SQL.

    EF4 is great - and if you need its power - go with it!

    But if your requirements are a lot less, it might just be overkill - continue to use Linq-to-SQL (I will) and be happy with it. I don't see any good reason to dump Linq-to-SQL - it's still totally available in .NET 4, has been blessed with some bug fixes and improvements even, and it will be around for at least another couple of years.

提交回复
热议问题