Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Round 1 Melbourne City -Brisbane Roar 2 - 0
- //Round 1 Central Coast-Newcastle Jest 1 - 5
- //Round 2 Melbourne City -Brisbane Roar 2 - 0
- void Main()
- {
- var matches = new[]
- {
- new
- {
- Round = 1,
- Home = "Melbourne City",
- Away = "Brisbane Roar",
- Score = "2 - 0",
- },
- new
- {
- Round = 1,
- Home = "Central Coast",
- Away = "Newcastle Jest",
- Score = "1 - 5",
- },
- new
- {
- Round = 2,
- Home = "Melbourne City",
- Away = "Brisbane Roar",
- Score = "2 - 0",
- },
- };
- var query = from match in matches
- group match by match.Round into groupings
- select new
- {
- Round = groupings.Key,
- Games = from grouping in groupings
- select new
- {
- grouping.Home,
- grouping.Away,
- grouping.Score,
- }
- };
- query.Dump();
- }
Add Comment
Please, Sign In to add comment