Skip to content

Instantly share code, notes, and snippets.

@srkirkland
Created October 27, 2015 23:05
Show Gist options
  • Save srkirkland/b8defc7a2475c1fb3ee2 to your computer and use it in GitHub Desktop.
Save srkirkland/b8defc7a2475c1fb3ee2 to your computer and use it in GitHub Desktop.
funky gifts
var completed = RepositoryFactory.GiftRepository.Queryable.Where(x => x.IsCompleted).ToArray();
var trans = await
_givingFinancialService.GetKfsAccountDetails(
completed.Select(c => new KfsAccountQueryParams {KfsKey = c.KfsKey}).ToArray());
var grouped = trans.GroupBy(t => t.KfsKey).Select(t => new {t.Key, total = t.Sum(x => x.Amount)});
var joined = from c in completed
join g in grouped on c.KfsKey equals g.Key
where c.Total != g.total
select new {c.KfsKey, c.Total, c.Id, g.total};
return new JsonNetResult(joined.ToArray());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment