views:

223

answers:

9

A book? An online tutorial? Stackoverflow? University? Trial and error?

I have been using LINQ to SQL and I want to learn how to use it better because I feel like I can only do very basic things and I don't really understand how to use the good features. For example I have no idea what this means:

public static IOrderedEnumerable<TSource> OrderByDescending<TSource, TKey>(
    this IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector
)

When I looked up OrderByDescending() on MSDN to try and figure out exactly how it works (instead of just using the code someone writes for me on SO) I am totally confused, what the hell is a TKey, etc? Now that is not the question I am asking here but I am wondering how/where is the best way to learn and master this stuff?

A: 

You probably want to learn more about generics and extension methods.

Hope you have a nice learning experience :-)

/Klaus

klausbyskov
A: 

Through this site. Scott Guthrie helped develop LINQ to SQL I believe.

Skunk
A: 

I bought Essential LINQ by Charlie Calvert and Dinesh Kulkani. Since they were involved in creating it, this is a big advantage.

Mark Bertenshaw
A: 

I learned by taking this course: Effective LINQ (Full Disclosure: I work for the company that offers it, so I could be biased), and by reading the book LINQ in Action

EDIT: I'd also add a vote for LINQPad, it's pretty good environment for some serious LINQing.

Jon Dewees
holy carp $1400 thats nearly 3 weeks of pay, I guess the only way that could be feasible for me would be if the company paid for it but I know they would never do that
shogun
Start with the book, it covers a LOT of ground but progresses nicely in a very understandable way. It should be quite helpful.
Jon Dewees
+2  A: 

Scott Guthrie has a six part "Linq-to-SQL" tutorial - part 1 is here, and has links to the next parts.

Excellent tutorial indeed!

Also. LINQPad is both an excellent learning and trial tool, and the site also has some good information on LINQ.

Plus I would also put my vote in for Linq In Action - both the book and the site.

marc_s
+4  A: 

Trial and error. I developed a small web site as a hobby project, chose to use some new technologies that I was interested in, and LINQ-to-SQL was one of them. Google was my friend all along and I have visited Scott Guthrie's web site many times.

I might elaborate a little here: I do not consider myself a master in LINQ-to-SQL, but I have used the technology, so when read TSource and TKey I know that it means "the type of the source elements" and TKey is "the type of the key to sort by". And since I do not know how to use the method I would hope to find an example on 101 LINQ Samples that would get me started.

Jan Aagaard
A: 

I got started with linq by going through 101 Linq samples and Linq pad. I then started rewriting some of our sprocs in Linq. Although I have not yet mastered IMO that just takes lots of real world implementations.

Aaron
A: 

Besides experimentation, Dimecasts helped alot! From another answer of mine:

You need to start looking into LinqPad and how to use it over at dimecasts. Also check out their series on the Delayed Execution features of Linq 2 Sql

Overall, dimecasts has 6 videos on Linq2Sql

Allen
A: 

I learnt by using LINQ to SQL in project. By trying something simple first to get the basic concepts, I could then expand on that when I was comfortable with it.

harriyott