A baseball Linq-er
- Posted: Jan 08, 2007 at 8:01 AM
- 12 Views
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.