小编Rog*_*ger的帖子

为什么VS2017允许Visual Studio 2010在linq查询中不允许使用“ is null”?

当我尝试使用Visual Studio 2010构建Visual Studio 2017解决方案(适用)时,它在下面的代码行上给了我一个语法错误。

var x = (from a in list where a.fld is null select a).ToList();
Run Code Online (Sandbox Code Playgroud)

我已经将该行更改为== null现在代码可以在两个版本的Visual Studio上编译,但是我想知道为什么is nullVS2010失败?

c# linq null c#-4.0 c#-7.0

3
推荐指数
1
解决办法
47
查看次数

标签 统计

c# ×1

c#-4.0 ×1

c#-7.0 ×1

linq ×1

null ×1