Wrong with Linq to SQL?

Or - how about Linq to SQL will make it unacceptable for any project, either new or existing? I wish to learn about the reason why you would not choose Linq to SQL for the project - including what project parameters allow it to be unacceptable.

It's not so adaptable to alterations in the database schema. You need to rebuild the dbml layer and regenerate your computer data contexts.

Like every ORM (I'm not engaging in the controversy whether it's an ORM or otherwise), you have to bear in mind what SQL has been produced, and just how which will influence your calls.

Card inserts aren't batched, so could be expensive in performance.

It's being sunsetted towards Entity Framework

Even though it's utilizing a provider model that will permit companies to become designed for other DBMS platforms, only SQL Server is supported.

[EDIT @ AugustLights - In my opinion: ] Lazy loading may take a little of hacking to obtain working.

That being stated, It it's very handy if used properly

For any project that must take advantage of databases apart from SQL Server:

1) You're kept in to presenting SQL Server

For any project with complex entity relations and/or relations that change progressively with time:

2) You're kept in to at least one-to-1 mapping of tables to classes

For any project that has to use 1.x versions of .Internet

3) Will not use .Internet 1.x

  • There's not a way to combine-n-match lazy loading / eager loading on the datacontext.
  • True persistance lack of knowledge is extremely difficult.
  • Mapping choices are limited. For instance, you will find no many-to-many associations.
  • Resyncing the mapping with schema changes is painful.

Despite the suggestions above I believe linq-to-sql is a superb option for many projects.

It is not easy to mock while unit testing due to deficiencies in an interface around the System.Data.Linq.DataContext class. Here is a possible approach: Mocking LINQ to SQL DataContext.

because you aren't using 3.5... is the fact that a legitimate answer?!?!?

Well, I've developed some programs using LINQ to SQL. Among the primary issues that I've found is needing to layer the application. In LINQ to SQL the entity courses are tied very carefully using the data access code. Also, you will find some difficulties with DataContext meaning which you can use a DataContext resist retrieve a product however, you cannot transfer the product (object) to a different DataContext (a minimum of not easily).

LINQ to SQL is going to be helpful if you do not worry about adding the application correctly as well as if whatever you wanted would be to create a credit card applicatoin inside a rapid manner also termed as RAPID Database Integration.

Many of the benefit to LINQ-to-SQL originates from allegedly having the ability to construct data queries in your code-behind according to strongly-typed queryable/enumerable data objects out of your dbml (which plays the role of the limited DAL). So a result, as was already pointed out, is it encourages you somewhat towards playing outdoors strongly defined and separated layers or tiers for your application.
To counter that time, it will mean that you ought to have the ability to eliminate most or all any company logic you had been writing into saved methods around the database, so then a minimum of you simply must see the code that are responsible for the information to alter non-schema-affecting business rules... However, that stops working a little whenever you understand how complicated it may be to create a question by having an outer join with aggregates with grouping, a minimum of when you initially approach it. So you will be enticed to create the sprocs within the SQL you realize that's so easy and proficient at doing individuals things instead of spend the additional time trying to puzzle out the LINQ syntax to complete exactly the same factor when it is just likely to convert it to ugly SQL code anyway...
That getting been stated, I truly deeply love LINQ, and my esteem for this greatly elevated after i began disregarding this "query syntax is simpler to seeInch sentiment I have seen going swimming and switched to method syntax. Never looked back.