开发者

Feasibility of entity framework and linq to sql

开发者 https://www.devze.com 2022-12-17 04:01 出处:网络
Is it worth spending time in these frameworks. Or they just another framework开发者_StackOverflow中文版 like microsoft developed in the form of MFC library.

Is it worth spending time in these frameworks. Or they just another framework开发者_StackOverflow中文版 like microsoft developed in the form of MFC library. I dont want to waste precious time, so please help. Under what scenarios these frameworks will be helpful.


EF and L2S are Object-Relational Mappers (ORM). They would be used wherever an ORM is used. StackOverflow uses Linq to SQL as its ORM layer, to good effect. Entity Framework is up-and-coming, and although it currently has issues, it will be greatly improved in the upcoming version 4.0.

Your time would be well spent learning one or both of these frameworks, as it will be highly likely you will use an ORM in your applications at some point.


It really depends on what your alternative is. If your alternative is using ADO.NET and DataSets, then yes, LinqToSql and EntityFramework are likely a step forward. If your alternative is NHibernate or another feature rich ORM, then they may be a step backward.

Microsoft has really strongly moved away from LinqToSql while still continuing to offer support for it and making minor changes. Microsoft is recommending all LinqToSql users move to Entity Framework. However, the Entity Framework that came out with VS 2008 SP1 / .NET 3.5 SP1 was in many ways a step back from LinqToSql. The Entity Framework that is coming out in April with VS 2010 and .NET 4.0 should be mostly an upgrade from LinqToSql, assuming you can migrate to VS 2010 / .NET 4.0 sometime in the near future.


YES! It is worth Learning. No! its not just another framework. It is useful for any application that uses a SQL Database to query data and present/do some logic.

Linq2Sql was introduced with .NET 3.5. Very useful if you dont have your own set of domain entities. A bit difficult to map Linq2Sql classes to our own domain entity classes in complexed scenarios.

But, recommend to use Entity Framework. EF was introduced with .NET 3.5 SP1. Much improved version of Linq2Sql and came as part of Olso Mixed Models. This can be used as a real ORM to map our own set of domain entities and the designer provides most of the features.

There is a new version of EF (EF4) ships with .NET 4.0. Watch Evolving ADO.NET Entity Framework in .NET 4 and Beyond for what you can do with EF4.

Download the "Layered Architecture Sample for .NET" from Codeplex.com

0

精彩评论

暂无评论...
验证码 换一张
取 消