If you are fed up with the obligatory business use cases used in Linq samples - you know, the Customers and Orders guys from the Northwind database - you may be interested in seeing less boring queries.
Derek Slager has published some
Linq queries he wrote to calculate baseball stats.
Example:
var battingAverageLeaders =
from game in games
from play in game.GetPlays()
where play.Result != null
group play by play.Batter into g
where g.Count(p => p.Result.IsAtBat) > 400
let pd = new PlayerData {
Player = g.Key,
Data = (Math.Round(1000.0d *
((double)g.Count(p => p.Result.IsHit) /
(double)g.Count(p => p.Result.IsAtBat))) / 1000.0d).ToString(".000") }
orderby pd.Data descending
select pd;