Linq query problem
I have the following information
var details = Details.Where(d => d.isActive);
I would like to query another table Authorizations
that has FK before Details
, and get the sums of the sums of the permissions that are contained in the object Details
, grouped by detail
and a FundCode
.
Details (1 to many)
Seems pretty simple, however I have a bit of a problem.
Here's what I currently have:
var account = (from sumOfAuths in Authorizations
where details.Contains(sumOfAuths.Details)
&& sumOfAuths.RequestStatusId == 2
group sumOfAuths by new { sumOfAuths.Detail, sumOfAuths.FundCode } into child
select new {
....
Amount = child.Amount
}).Sum()
The problem is that inside the function .Sum()
I have a set of objects, not 1. So I cannot sum the sums correctly.
+2
a source to share