开发者

What is difference between .edmx and .dbml file in linq?

What is difference between .ed开发者_如何转开发mx and .dbml file in linq?In VS 2008 which datasource is best choice where edmx or dbml?Any problem will arise using edmx file in VS 2008?Can i use edmx in VS-2008?


edmx is the modeling file for Entity Framework.

dbml is the modeling file for Linq 2 Sql.

You should spend your time learning Entity Framework as Linq 2 Sql is deprecated.


.edmx is the Entity Framework. .dbml is LINQ-to-SQL. While their general purpose is the same, they are entirely different frameworks. Entity Framework is newer and will probably be the best investment of your time to learn since I suspect that is where a lot of innovation is going to go.


Both are introduced as latest technologies and at times a bit confusing when to use which. Entity Framework and LINQ to SQL have a lot in common but still different from each other in quite a few ways:

Entity Framework:
1. Enterprise Development:
2. Works with Conceptual model of database:
3. Works with all data sources:
4. ".EDMX" is created while using Entity Framework:

LINQ::
1. Rapid Application Development:
2. Works with objects in database:
3. Mainly woks with SQL Server:
4. ".dbml" is created while using LINQ to SQL:
:

Entity Framework is more targeted towards Enterprise Development where the schema is usually optimized for storage considerations like performance consistency and partitioning. Entity Framework is designed around exposing an application-oriented data model that is loosely coupled and may differ from the existing database schema. For example, you can map a single entity (class) to multiple or map multiple entities to the same table. Entity Framework has “.edmx” (ADO.NET Entity Model) file when added in the application.

LINQ to SQL mainly has features to support Rapid Application Development against SQL Server. LINQ to SQL allows you to have a strongly typed view of your existing database schema. You can build LINQ queries over tables and return results as strong typed objects. LINQ to SQL has “.dbml”(LINQ to SQL) file when added in the application. You can use LINQ to SQL by decorating the existing classes with the attributes.

[Original source: https://parassanghani.blogspot.com/2011/01/entity-framework-vs-linq-to-sql.html]


LINQ to SQL mainly has features to support Rapid Application Development against SQL Server. LINQ to SQL allows you to have a strongly typed view of your existing database schema. You can build LINQ queries over tables and return results as strong typed objects. LINQ to SQL has “.dbml”(LINQ to SQL) file when added in the application. You can use LINQ to SQL by decorating the existing classes with the attributes.


I never understood the literature like definitions. Anyways the bottom line is L2S is lightweight and EF is heavy weight. Meaning L2S works only with SQLServer and EF works with many more.

Reference: Difference between L2S and EF

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜