Skip to content

Instantly share code, notes, and snippets.

@kjellski
Created October 26, 2012 08:16
Show Gist options
  • Save kjellski/3957582 to your computer and use it in GitHub Desktop.
Save kjellski/3957582 to your computer and use it in GitHub Desktop.
Get an A with the smallest Count of Condition satisfied on B
SetA.Select(m => new {
A = m,
Count = m.SetB.Where(n => n.Condition == true).Count()
}).OrderBy(m => m.Count).Select(m => m.A).First()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment