tags:

views:

143

answers:

5

As LINQ is a good query language in dot net and everyone should be able to work with it. What are the necessary abilities which a programmer should have, before start learning LINQ.

And after that, What should he know about LINQ? (important tips)

+2  A: 

A decent understanding of Closures / Lambda, IEnumerable, Generics, Expression Trees and Method Chaining, would be a good start. LINQ is pretty much just a utility set based upon that.

But you can definitely learn to utilize LINQ without a solid understanding of each and every single feature mentioned.

David Hedlund
@David Is T-SQL essential ?
Nasser Hadjloo
All the above, plus: Extension Methods.
jonathanconway
@Nasser, it could be useful if you wanted to look at the SQL code being generated by Linq, say, to identify performance issues.
jonathanconway
@jonathanconway: I completely forgot! Def. extension methods. Anyway, I guess my answer is redundant now that ian31 has published a more comprehensive list.
David Hedlund
A: 

There is a series of videos (8, I believe) Scott Stanfield called "LINQ TO SQL." They are very helpful to understand the concept and how to use LINQ.

Link Here

Or, try google: LINQ TO SQL + Scott Stanfield

I particularly like to use, but little use. is always good care ... but it is very useful. Watch the videos and draws its conclusions.

Enjoy!

Ph.E
@PH.E I'm looking for skills which you need to be awareof those tolearn LINQ, not a good series of LINQ Tutorial. (but thankyou for your tutorial series)
Nasser Hadjloo
@Nasser I believe the best is you go to practice, trying, and will soon be dominating all areas of LINQ. For me it worked well (of course, I am not an expert on LINQ).But my friend, good luck and good studies.
Ph.E
+8  A: 

What kind of Linq are you interested in - Linq to Objects, Linq to SQL, implementing your own Linq provider ?

My advice is that you should first learn about the features that Linq is based upon :

  • IQueryable and IEnumerable extension methods

  • Method chaining and deferred execution

  • Anonymous methods and lambda expressions

  • Linq query syntax

  • Expression trees (if you aim at implementing your Linq provider)

Then in turn these features rely on more basic concepts :

  • Generics

  • Delegates

  • Collections

A couple of books that could help you :

  • C# in depth (J. Skeet) - great book to learn C#
  • LINQ in Action (Marguerie, Eichert, Wooley)
ian31
+1  A: 

If you want to understand the principles behind LINQ than it is very useful to learn some basics of functional programming, because LINQ is largely based on this paradigm. Of course, you don't need that to use LINQ in practice, but it will help you understand what's going on under the cover (not to mention that learning functional programming is said to make you a better programmer anyway).

I wrote an overview article on this topic that you may find useful:

Aside from functional programming, it really helps to understand all C# 3.0 features, most importantly lambda expressions, extension methods and also expression trees. Technically speaking, LINQ is just a clever combination of these three features, so once you understnad them, you can fully appreciate and benefit from LINQ.

Tomas Petricek
+1  A: 

101 LINQ samples really helped me to understand LINQ better http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx?ppud=4

Fedor