Basically when I do the following query, if no leads were matched the following query throws an exception. In that case I\'d prefer to have the sum equalize 0 rather than an
Try this instead, it's shorter:
db.Leads.Where(..).Aggregate(0, (i, lead) => i + lead.Amount);