此问题已在此处有答案:
Force linq sum to return null(5个答案)
11天前关闭
var num = new List<double?>{null};
var result = num.Sum(d => (double?)d);
Console.WriteLine(result is null);
如何让这一回归成为现实?
此问题已在此处有答案:
Force linq sum to return null(5个答案)
11天前关闭
var num = new List<double?>{null};
var result = num.Sum(d => (double?)d);
Console.WriteLine(result is null);
如何让这一回归成为现实?
1条答案
按热度按时间qvtsj1bj1#
我不认为这是可能的“一去”,但你可以这样做,以获得所需的结果: