Created
October 27, 2015 23:05
-
-
Save srkirkland/b8defc7a2475c1fb3ee2 to your computer and use it in GitHub Desktop.
funky gifts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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