A baseball Linq-er

Published 08 January 07 11:01 AM | Coding4Fun 

Derek Slager wrote an example to show off LINQ, language integrated query, using baseball.  For those who don't really follow sports, baseball has a state for literally everything.  While in Wrigley Field, I've heard people rattle off "He can bat a .405 against a left handed pitcher on every other thursday of the month."

Now what is linq?  Here is a quick example.  For more information, visit MSDN's LINQ project.

   1:  WriteRankedList(from game in games
   2:                  group game by game.WinningPitcher into g
   3:                  orderby g.Count() descending
   4:                  select g);

Now I just need to find where to score a hotdog in the middle of Winter.

Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required

Search

This Blog

Syndication

Page view tracker