Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
9 views

Difference Between LINQ To SQL and Entity Framework

The document compares LINQ to SQL and Entity Framework. LINQ to SQL only works with SQL Server, while Entity Framework supports multiple databases. Entity Framework supports more complex data types and relationships and allows database generation from models.

Uploaded by

Raghu Gowda
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Difference Between LINQ To SQL and Entity Framework

The document compares LINQ to SQL and Entity Framework. LINQ to SQL only works with SQL Server, while Entity Framework supports multiple databases. Entity Framework supports more complex data types and relationships and allows database generation from models.

Uploaded by

Raghu Gowda
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

6/28/2014 Difference between LINQ to SQL and Entity Framework

Difference between LINQ to SQL and Entity


Framework
P o st e d By : S h aile ndra Ch auh an, 3 0 Mar 2 0 1 4
U pdat e d On : 3 1 Mar 2 0 1 4
Ke y wo rd s : l i n q t o s q l v s e f, e n t i t y fra me wo rk v s l i n q t o s q l

L INQ to SQL allow you to query and modify SQL Server database by using LINQ syntax. Entity
framework is a great ORM shipped by Microsoft which allow you to query and modify RDBMS like SQL
Server, Oracle, DB2 and MySQL etc. by using LINQ syntax. Today, EF is widely used by each and every .NET
application to query to database. The difference between LINQ to SQL and EF is given below.

LINQ to SQL Entity Framework

It only works with SQL Server Database. It can works with various databases like Oracle, DB2,
MYSQL, SQL Server etc.

It generates a .dbml to maintain the relation It generates an .edmx files initially. The relation is
maintained using 3 different files .csdl, .msl and .ssdl

It has not support for complex type. It has support for complex type.

It cannot generate database from model. It can generate database from model.

It allows only one to one mapping between the It allows one-to-one, one-to-many & many-to-
entity classes and the relational tables /views. many mappings between the Entity classes and the
relational tables /views

It allows you to query data using DataContext. It allows you to query data using EntitySQL,
ObjectContext, DbContext.

It provides a tightly coupled approach. It provides a loosely coupled approach. Since its code
first approach allow you to use Dependency Injection
pattern which make it loosely coupled .

It can be used for rapid application development It can be used for rapid application development
only with SQL Server. with RDBMS like SQL Server, Oracle, DB2 and
MySQL etc.

What do you think?


I hope you will enjoy the LINQ to SQL and EF while playing with database. I would like to have feedback
from my blog readers. Your valuable feedback, question, or comments about this article are always
welcome.

http://www.dotnet-tricks.com/Tutorial/entityframework/1M5W300314-Difference-between-LINQ-to-SQL-and-Entity-Framework.html 1/2
6/28/2014 Difference between LINQ to SQL and Entity Framework

Print Article

Share this article with your friends!


in S h a r e 2

Tw eet

About the Author

Shailendra Chauhan works as Software Analyst at reputed MNC and has more than 5 years of hand
over Microsoft .NET technologies. He is a .NET Consultant and is the founder & chief editor of
www.dotnet-tricks.com and www.dotnetinterviewtricks.com blogs. He is an author of book ASP.NET
MVC Interview Questions and Answers.
He loves to work with web applications and mobile apps using Microsoft technology including ASP.NET,
MVC, C#, SQL Server, WCF, Web API, Entity Framework,Cloud Computing, Windows Azure, jQuery,
jQuery Mobile, Knockout.js, Angular.js and many more web technologies. More...

http://www.dotnet-tricks.com/Tutorial/entityframework/1M5W300314-Difference-between-LINQ-to-SQL-and-Entity-Framework.html 2/2

You might also like