给出以下声明
int[] numbers = { 0, 1, 2, 3 };
我注意到.NET 4.6.1上的VS 2015允许以下内容采用前三个数字
IEnumerable<int> firstThree = System.Linq.Enumerable.Take(numbers, 3);
但是,它不允许以下情况
IEnumerable<int> firstThree = numbers.Take(3);
我是C#的新手,无法理解为什么无法将调用解析为扩展方法。
最佳答案
您是否错过添加
using System.Linq;
关于c# - C#取算符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38672993/