我有这个简单的 LINQ 查询:
Dim sourceSect = (From sect In allSections
Where sect.ORDER = sourceNode.Index
Select sect).Single()
sourceSect.ORDER = targetNode.Index
但是,如果我在线编写它:
(From sect in allSections Where sect.ORDER = sourceNode.index Select sect).Single().ORDER = targetNode.Index
我从 Visual Studio 收到语法错误。
有什么合理的理由吗?:)