Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET: Converting from LINQ to SQL to Entity Framework

To get the prototype for a project up and running as quickly as possible, I used LINQ to SQL for data persistence.

Now the project is more mature and I'm running into concurrency limitations with LINQ to SQL. Since its not a true ORM, nor was it meant for enterprise use, I'd like to replace all the LINQ to SQL work with Entity Framework persistence.

What's involved in this? Can any of my LINQ to SQL work be retooled for EF? Am I going to have to start over with EF from scratch? Where do I start? Any helpful links or advice?

like image 818
AgileMeansDoAsLittleAsPossible Avatar asked Jan 25 '11 19:01

AgileMeansDoAsLittleAsPossible


People also ask

Does Entity Framework use LINQ to SQL?

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.

Which is better Entity Framework or LINQ to SQL?

First off, if you're starting a new project, use Entity Framework ("EF") instead of Linq to SQL because it now generates far better SQL (more like Linq to SQL does) and is easier to maintain ("L2S").

What is the difference between Entity Framework and LINQ?

Entity Framework is an object-relational mapping (ORM) framework for connecting C# code to external databases, usually SQL Server. LINQ is a query language embedded into C# and a set of extension methods in order to make it useful.

Can we use Entity Framework without LINQ?

Short answer: Neither, because those are uncomparable. But if you mean Linq To SQL vs Entity Framework, then Entity Framework is better. Both, Linq to SQL and Entity Framework are data access frameworks and both supports Linq for querying data.


1 Answers

Many people are doing the same conversion. There is a template that you can use to do the conversion here http://blogs.msdn.com/b/efdesign/archive/2009/08/13/linq-to-sql-to-entity-framework-conversion-template.aspx

like image 181
Shiraz Bhaiji Avatar answered Oct 24 '22 03:10

Shiraz Bhaiji