I have a query that looks like this:
var TheQuery = (from t in MyDC.Table
where....
select new MyModel()
{
Property1 = (int?)... ?? 0
}
Sometimes, the where clause in the query returns no data to do the select. When this happens, MyModel is null. I was hoping that with the ?? 0 for every property the query would still return an object with Property1 set to 0.
How do I rewrite this so that when no data exists to fill MyModel, MyModel doesn't come back null?