I have an object like this:
public class MyObject{ public int Prop1 {get;set;} }
I make a linq to sql query that returns a MyObject list as follows:
var TheQuery = from .... where .... select new MyObject() { Prop1 = (...... ).Sum( d => d) }.ToList();
The problem is that Prop1 is the sum of the subquery, and sometimes nothing can be returned, and Sum is null, which Prop1 cannot be assigned because it is int.
How good to do it.
Thanks for your suggestions.
source share