You could use something like this:
var fees = from fee in schoolFeesResult
let weight = fee.Amount.Value / totalFees
select new
{
TuitionFee = weight * fee.TuitionFee.Value,
TravellingFee = weight * fee.TravellingFee.Value,
ResidentialFee = weight * fee.ResidentialFee.Value
};
// if the calculation of the fees is a performance bottleneck,
// uncomment the next line:
// fees = fees.ToList();
return new SchoolFees(
new Percentage(fees.Sum(x => x.TuitionFee),
new Percentage(fees.Sum(x => x.TravellingFee),
new Percentage(fees.Sum(x => x.ResidentialFee));
You could go even further:
var fees = (from fee in schoolFeesResult
let weight = fee.Amount.Value / totalFees
group fee by 1 into g
select new
{
TuitionFee = g.Sum(x => weight * x.TuitionFee.Value),
TravellingFee = g.Sum(x => weight * x.TravellingFee.Value),
ResidentialFee = g.Sum(x => weight * x.ResidentialFee.Value)
}).Single();
return new SchoolFees(
new Percentage(fees.TuitionFee,
new Percentage(fees.TravellingFee,
new Percentage(fees.ResidentialFee);
But I doubt that this second version is a good idea. It makes the code hard to understand. I added it purely for academic reasons, to show what is possible.