Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's wrong with Linq to SQL?

What's wrong with Linq to SQL?

Or - what about Linq to SQL would make it unsuitable for a project, either new or existing? I want to hear about why you would not choose Linq to SQL for a particular project - including what project parameters make it unsuitable.

like image 404
Erik Forbes Avatar asked Oct 02 '08 23:10

Erik Forbes


People also ask

Is LINQ to SQL still supported?

LINQ to SQL was the first object-relational mapping technology released by Microsoft. It works well in basic scenarios and continues to be supported in Visual Studio, but it's no longer under active development.

Should I use LINQ to SQL?

More importantly: when it comes to querying databases, LINQ is in most cases a significantly more productive querying language than SQL. Compared to SQL, LINQ is simpler, tidier, and higher-level. It's rather like comparing C# to C++.

Is LINQ converted to SQL?

LINQ to SQL translates the queries you write into equivalent SQL queries and sends them to the server for processing. More specifically, your application uses the LINQ to SQL API to request query execution. The LINQ to SQL provider then transforms the query into SQL text and delegates execution to the ADO provider.

Which is better Entity Framework or LINQ to SQL?

LINQ 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 .


1 Answers

It is not very adaptable to changes in the database schema. You have to rebuild the dbml layer and regenerate your data contexts.

Like any ORM (I am not getting into the debate as to whether it is an ORM or not), you do have to be aware what SQL is being generated, and how that will influence your calls.

Inserts are not batched, so can be high cost in performance.

It's being sunsetted in favour of Entity Framework

Despite the fact it is using a provider model that will allow providers to be built for other DBMS platforms, only SQL Server is supported.

[EDIT @ AugustLights - In my experience: ] Lazy loading may take a bit of hacking to get working.

That being said, I think it it is very handy if used correctly

like image 80
johnc Avatar answered Oct 07 '22 17:10

johnc