Skip to content

Instantly share code, notes, and snippets.

@chadedrupt
Created August 8, 2012 02:18
Show Gist options
  • Save chadedrupt/3291477 to your computer and use it in GitHub Desktop.
Save chadedrupt/3291477 to your computer and use it in GitHub Desktop.
LINQ grouped SUM
var jobsOwing = from t in Db.Transactions
group t by t.Job into g
where g.Sum(t => t.Value) < 0
select new { Job = g.Key, NetPosition = g.Sum(t => t.Value) };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment