问题描述
大家好,大家好。
我正在学习c#collections并找到一些LINQ检索查询,但无法理解我们必须在哪里使用iEnumeralbe以及我们可能在哪里不需要它,
如果有人给我以下两种类型的区别,对我来说会更进一步......感谢先生们...... br $>
int []整数= {1,9,5,3,7,2,11 ,23,50,41,6,8};
IEnmerable< int> takeWhileNumber = integers.TakeWhile(num =>
num.CompareTo(50)!= 0);
int [] takeWhileNumber;
int []整数= {1,9,5,3,7,2, 11,23,50,41,6,8};
takeWhileNumber = integers.TakeWhile(num =>
num.CompareTo(50)!= 0);
Hi and Hello everybody,
I am learning c# collections and found some LINQ retrieving queries , but couldn't understand where we must use iEnumeralbe and where we may not need it,
if anybody gives me the difference of the following two types, would be greatful for me to move further... thanks in advance guys..
int[] integers = { 1, 9, 5, 3, 7, 2, 11, 23, 50, 41, 6, 8 };
IEnmerable<int> takeWhileNumber = integers.TakeWhile(num =>
num.CompareTo(50) != 0);
int[] takeWhileNumber ;
int[] integers = { 1, 9, 5, 3, 7, 2, 11, 23, 50, 41, 6, 8 };
takeWhileNumber = integers.TakeWhile(num =>
num.CompareTo(50) != 0);
这篇关于c#查询内存中对象的两种类型之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!