15

I have set myself upon a journey to educate my coworkers (all have accepted my mission, even the boss). Every day I seem to find a piece of code that could have been less error prone if my coworkers knew more about the framework, better-know-framework (in courtesy of DNR ;)) is part two of my teaching process. First part is teaching my coworkers about LINQ, what it can do for them and how it is written.

My big question is where are all the good basic resources for LINQ education, everything if find is tightly coupled to Linq2Sql or all other sorts of material. Neither have I been able to find a tutorial for the actual linq syntax (except a specification of it all).

(I hope this haven't been asked before but if it has please say so, cause then my searching skills have failed ;) )

Basic tutorials (free):

Basic tutorials (commercial sites):

Reference sites:

2

10 Answers 10

8

I find this helpful:

101 LINQ Samples

and a good post on joins.

2
  • An excellent resource. Another "101 LINQ Samples" exists - for VB.NET. +1.
    – M.A. Hanin
    Apr 28, 2010 at 14:41
  • I find 101 great for samples but I kindda miss the basic "this is LINQ, this is how it's meant to be read"
    – cyberzed
    Apr 28, 2010 at 14:59
6

My suggestion would be to simply have your co-workers download LINQPad.

The software has some tutorials that should cover the basics and it will give them an environment where they can see results almost immediately.

3
  • 1
    Just downloading LINQPad won't do the job...I need input for me holding a session for them. Besides that they would never use LINQPad since we never connect directly to MSSql or so. (everything goes through ESRI's ArcSDE )
    – cyberzed
    Apr 28, 2010 at 14:42
  • @cyberzed Have them download LINQPad for a training session. Train them using the tutorials (you can either have them connect to a dummy AdventureWorks database or create some boilerplate scripts and use LINQ to Objects). Beyond the training, they won't need LINQPad. Apr 28, 2010 at 14:54
  • Hmmm, I would prefer teaching them with stuff that relates to what we do. I always found sessions to be semi-disturbing if you have no clue about the data. For some reason none of my coworkers or I have been shuffling about AdventureWorks db.
    – cyberzed
    Apr 28, 2010 at 14:58
4

two that I use are

Hooked on Linq

and

MSDN 101 samples

1
  • 2
    The MSDN 101 samples are handy! (Even if MSDN still has them under "Future Versions" of C#.) Apr 28, 2010 at 14:55
2

Buy the office a copy 100 copies of Jon Skeet's C# In Depth. It not only covers LINQ syntax and lambda expressions, it is also a good primer for getting people up-to-speed on changes to the language since C# 1.

http://csharpindepth.com

4
  • I liked this book because it builds up all the new features in C# 3, all of which exist basically to support LINQ.
    – Matt Greer
    Apr 28, 2010 at 14:49
  • 1
    Might I suggest buying the office several copies instead of just one? It never hurts to have an emergency backup copy ;)
    – Jon Skeet
    Apr 28, 2010 at 20:07
  • Quite right. Buy a dozen cases of C# In Depth and store some offsite in an environmentally-controlled storage facility because you never know when disaster might strike. Better safe than sorry. Apr 28, 2010 at 20:13
  • Hmm I would say 3 pr. developer...one at the office, one at home and one in the bag with the laptop :D And if you could make the next revision have a GPS module so we can keep track of 'em with our software then it would be lovely :) P.S. I'll have a look at it this weekend and probably poke the boss about at least 1 copy next week (hmm, I'll have to do something good now that I just doubted the words of Mr. Skeet (I'll buy you a beer next time in the UK))
    – cyberzed
    Apr 29, 2010 at 9:09
1

There's a nice one on MSDN.

1
  • banging head against the table How did I miss that one?
    – cyberzed
    Apr 28, 2010 at 15:00
1

If it doesn't have to be free, the Mastering LINQ Series on Tekpub is great. The guy shows a concept (like a foreach loop to filter data) using "normal" C# code and then using LINQ.

No L2S at all, but all the underlying concepts.

1
  • Agree with this one, the TekPub series is good. The tutor (for want of a better word) Justin Etheridge has an excellent blog... see my answer for that one:)
    – Steve
    Apr 28, 2010 at 14:46
1

Another answer already mentioned Justin Etheridge's series on TekPub, which is good. Justin also wrote a good blog post comparing LINQ to loops which is worth a look: http://www.codethinked.com/post/2009/06/15/Life-After-Loops.aspx#continue

0

Is anyone on your team familiar with SQL? I don't mean to fucus on Linq2SQL but I have found that people with familiarity with the declarative-nature of SQL (express WHAT you want, not HOW) seem to grasp LINQ more quickly. They might be able to help you reach the rest.

2
  • Everyone on the team knows SQL, so the trick is making sure they understand the syntax since it's a slight variant :)
    – cyberzed
    Apr 28, 2010 at 14:49
  • The slight variation throws me sometimes too - but the familiarity with 'what not how' is a big win in learning linq.
    – n8wrl
    Apr 28, 2010 at 16:26
0

The way I learned a LOT about it is with ReSharper. ReSharper 5's functionality in this is quite an improvement over the 4, in fact...suggesting and converting loops into LINQ method chains with ease.

Of course, you want them to learn as well, so it's important to have em WRITE it as well as having tools like that help out.

1
  • On top of that we would have to invest money in ReSharper as well...plus convincing 66% of the developer team that an addon would help them (I'm currently using CodeRush but some of the other devs are of the opinion that it's not needed at all).
    – cyberzed
    Apr 29, 2010 at 10:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.