Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I consider LINQ to Entities?

I'm just starting with the Microsoft stack doing a web site in ASP.Net MVC and so far using LINQ to SQL. Should I consider LINQ to Entities? Does it have anything special to offer? If so, what?

like image 680
pupeno Avatar asked Mar 01 '23 14:03

pupeno


1 Answers

I have been investigating this exact thing myself.

Here are my findings in a nutshell

LINQ to SQL

Advantages

  • Incredibly easy to use

Disadvantages

  • Cannot update the diagram from the database, you have to delete your class and then drag it back onto the diagram from the DB. This is a real pain if you modified the diagram at all.

  • Not actively being developed any more (they will develop Entity Framework instead).

Entity Framework

Advantages

  • Has much more functionality (Table inheritance, etc...)

  • Can be updated from the database

  • Has multiple providers (not just SQL)

  • The model can be queried without using LINQ, you can use Entity SQL

  • Microsoft seems to be investing heavily on it and proposing it as the main way to access a database: Update on LINQ to SQL and LINQ to Entities Roadmap, Clarifying the message on L2S Futures.

Disadvantages

  • Complicated and a lot less intuitive

Conclusion

I personally decided to go down the route of using the Entity Framework. I bought a book and have read the online material and I am very impressed with it. It took a little extra effort to learn, but the benefits really are great.

like image 112
Doctor Jones Avatar answered Mar 31 '23 01:03

Doctor Jones