Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class PlanesLogRow
- {
- public DateTime ArriveDate;
- public string Origin;
- public string Destination;
- }
- var rez2 = planes.SelectMany(p => new[] {
- new { Airport = p.Origin, IsOrigin = true },
- new { Airport = p.Destination, IsOrigin = false }
- })
- .GroupBy(x => x.Airport)
- .Select(g => new
- {
- Airport = g.Key,
- LeftCount = g.Count(x => x.IsOrigin),
- ArrivedCount = g.Count(x => !x.IsOrigin)
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement