我不太了解C#,但我有这个项目,我正在努力做我想做的事情:
SortedDictionary<int, List<ChessMove>> possibleMovesByRank = new SortedDictionary<int, List<ChessMove>>();
...
var best = possibleMovesByRank.Keys.Last();
Run Code Online (Sandbox Code Playgroud)
从我能够找到的,这应该使用linq返回具有最高值的键,但VS给我一个错误:
SortedDictionary.KeyCollection does not contain a definition for 'Last' and no extension method for 'Last'
Run Code Online (Sandbox Code Playgroud)
我错过了什么或者我的项目设置不正确还是什么?