Created
March 23, 2011 19:05
-
-
Save CraigStuntz/883732 to your computer and use it in GitHub Desktop.
WCF Data Services doesn't support nested aggregates. But DataServiceQuery does -- with certain gotchas.
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 result = _unitOfWork.BillingBatches | |
.Select(batch => new BillingBatch | |
{ | |
Id = batch.Id, | |
Description = batch.Description, | |
FundingSource = batch.PayerCustomer.Name, | |
Amount = batch.Bills.Select(bill => bill.NetTotal).Sum(), // turns into $expand -- EF would have used SQL SUM() | |
Created = batch.Created | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment