I'm trying to generate a chart of the form:
User A User B Owes Owed Net
Sam David $20 $10 $10
Timbo ODP $30 $0 $30
Using the following query:
var debt = from user in users
select new {
Username = username,
User = user,
Owes = owedBetween(username, user),
Owed = owedBetween(user, username),
Net = Owes - Owed // doesn't compile
};
The problem is that that last line doesn't compile. Is there a way to set up the Net
value in the query, or must I initialize it to zero then change it afterwards?