>>>>>>>var list = (from d in _dbSet.Where(x => x.Account == accountName && x.Hidden == false) >>>>>>> from t in transact .Sum(s=>s.extension).Where(w=>w.extension != null && w.invoiceNo == d.InvoiceNo). >>>>>>> select(x => new InvoicesList { InvoiceNo = x.InvoiceNo, Account = x.Account, Hidden = x.Hidden, >>>>>>> Descrip = x.Descrip1, Finalized = x.Finalized, Created = .DateTime}, InvoiceBalance= t)).ToList(); >>>>>>>>
> > var list = new List<decimal?> {2.5M, null, 2.5M, 5M}; > var s = list.Sum(); >>
>var list = (from d in _dbSet.Where(x => x.Account == accountName && x.Hidden == false) > from t in transact .Sum(s=>s.extension).Where(w => w.invoiceNo == d.InvoiceNo). > select(x => new InvoicesList { InvoiceNo = x.InvoiceNo, Account = x.Account, Hidden = x.Hidden, > Descrip = x.Descrip1, Finalized = x.Finalized, Created = .DateTime}, InvoiceBalance= t)).ToList(); >The problem is not the NULL, the problem is that you can not use Sum(s=>s.extension) and then Where as after you get sum, it just creates decimal. If I try to swap where and SUM I get other errors.