Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 boo 脚本中有一个列表,想使用 System.Linq 扩展方法,但 boo 编译器抛出此异常:
BCE0019: Boo.Lang.Compiler.CompilerError: 'ToList' is not a member of 'System.Linq.IQueryable`1[[...]]'.
(“...”是我的对象的类型)
什么版本的布?从 0.9.0 开始支持扩展方法。如果您不能在您正在使用的版本中使用扩展方法,则必须使用绝对方法调用,例如 Enumerable.Select(...)。
正如@Jean 所说,你也导入了System.Linq吗?
System.Linq
我应该导入 System.Linq.Enumerable 而不是 System.Linq
感谢 Jean 和 Matthew 的回答。