Didn't jump on the Linq winner, what are your reasons for not using linq?

I seem to be in the minority, but to be honest, I’m not comfortable working with linq and don’t see any advantages in my personal development (not to mention that there are no advantages, just a personal opinion based on my situation).

I am building web applications (.net, .net mvc) and I like to have part of my data layer in stored procedures. One thing I love about sprocs is that I can generate all the db before the script, then scan my queries, readable queries I could add at a high level.

For those of you who don't like linq, what is the reason? Is it just a lack of knowledge / learning curve or is there a business example to not use it?

+4
source share
14 answers

I really use Linq, but not for SQL query. I use it as a very simple way of querying data, for example, finding the highest value in a datatable. I used to use a for loop for this code, but Linq makes it tidier and more understandable with respect to my intentions.

Once you understand that Linq is a general-purpose .NET query language, its power and utility become much clearer.

+6
source

So you never collect collections in C # code? Looking for the maximum value in a collection or filtering or grouping, etc.? I know that I do this quite often. LINQ allows me to do this in a very readable, declarative way (more readable than SQL, IMO - the order of the query is more logical).

Similar to an XML query with LINQ to XML, a dataset with LINQ to DataSet, etc. Oh, and don't forget about parallelization with PLINQ.

There are many reasons to love LINQ :)

+4
source

It has recently been discussed whether LINQ or stored procedures should be used, which includes the advantages and disadvantages of each approach.

And some people are worried about the future of LINQ to SQL.

Is LINQ to SQL DOA?

Did Microsoft really kill LINQ to SQL?

+2
source

I use LINQ for queries in arrays or general lists. It is very easy to read and saves a lot of input for foreach -loops, even if I look through multiple lists.

+1
source

I was not worried about LINQ yet, as there was no real need for me.

Over the years, I have learned "Learn-On-Demand" - new technologies come and go so quickly that you can spend a lot of time studying the latest trends, just to disappear next year.

Without indicating that LINQ will seem to be well received, but I do not lose sleep over coding things “the old way” while my design sounds.

+1
source

The original poster confuses Linq (lambda expressions for queries) with DLinq (Linq for lightweight databases) because they are used almost synonymously with the community.

You can use Linq with any collections and use the Sql syntax on it. Its pretty neat.

And yes, you can execute stored procedures using DLinq. See link below

http://weblogs.asp.net/scottgu/archive/2007/08/23/linq-to-sql-part-7-updating-our-database-using-stored-procedures.aspx

-RVZ

+1
source

We have not yet been able to use Linq, because we are still on 2.0, and we were not allowed to upgrade to a newer version.

+1
source

I hate SQL and have been using LINQ for the last year or so. I definitely prefer LINQ syntax over SQL syntax any day.

0
source

Using a stored procedure or Linq is your choice, of course, both have pros and cons.

Basically, as a pro for Linq, you don’t have to spend your time creating a data layer, but in stored procedures you need to write a new stored procedure for each object (maybe you can have a general solution for this “saved” hell process ", but I think it will be difficult to maintain.) And I also think that storing a stored procedure is more complicated than Linq (of course, after you spent a little time with Linq.)

But, as expected, retrieving data using stored procedures is faster than using Linq.

And after Oracle and other Linq database support happen; if you are still using the stored procedure and you need to change your database or you want to support a different database, then you need to write Oracle and a different version of the database of these stored procedures, and I think that then it will be real hell, but not in Linq.

0
source

I am currently creating software for Windows XP Embedded. I made a few spikes using linq, and I had to pull it out because XP is currently only built in to support .Net 3.0 or lower, bummer. It wasn’t much, but my code looked much better with Linq than without.

I have not used Linq for SQL yet. I tried using Linq for NHibernate beta testing, and when it is ready, it is definitely suitable for me when I have to do something with the database again.

0
source

I like LINQ. It is easy to read and write. I do not need to worry about my sql query optimization. His delayed operation makes her cooler. I can return IQueryable, which is awesome.

0
source

The company I work for has one business thing: not to use Linq (for SQL):

They like stored procedures because they can be changed after deployment without the need for recompilation, reinstallation, etc.

Personally, I do not really like this argument. Since so many people can (and do) make changes to sps on customer sites, it can be very difficult to provide effective support.

Linq is a very good technology that allows you to perform many tasks in .net very simply and efficiently (according to the reason of time). In addition, Linq to SQL provides a very good mechanism for calling stored procedures.

0
source

Currently, the problem of lack of knowledge / training (lack of time) is a problem.

0
source

I would prefer to use SQL to query the databases directly (via stored procedures) and then use LINQ to add additional data to the data, such as grouping.

0
source

All Articles