I have an object like this:
public class MyObject{
public int Prop1 {get;set;}
}
I'm doing a linq to sql query that returns a list of MyObject like this:
var TheQuery = from ....
where ....
select new MyObject()
{
Prop1 = (...... ).Sum( d => d)
}.ToList();
The problem is that Prop1 is a sum of a subquery and sometimes there might be nothing returned and the Sum is null, which can't be assigned to Prop1 because it's an int.
What's a good way around this.
Thanks for your suggestions.