Thanks for the reply. On the same line is there a way to return IEnumerable<Customer> by grouping the list by a property say State and Aggregating Expense and Income.
public IEnumerable StateGrouped
return ExpressionObserver.Execute(custOrdersList, t =>
from q in t.OfType().ToList()
q.Expense, q.Income, q.State
} by q.Moniker
I am trying to return an IEnumerable grouped by a property State with Aggregated values for Income and Expense.
In essence this is what I am trying to observer
var q = _selectedCustomers.OfType().GroupBy(x => x.State)
.Select(x => new CustomerSummary
State = x.First().State,
Expense = x.Sum(p => p.Expense),
Income = x.Sum(p => p.Income),
}).OrderByDescending(c => c.Expense);
q here returns a list grouped by state with aggregated expense and income.
Again thanks alot for your help