[英]C# Take operator
给出以下声明
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;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.