7
これは簡単な質問ですが、Where
とWhere<T>
などのメソッドを持つList<T>
のようなコレクションクラスには一般的で非汎用的なメソッドがあります。一般的な拡張メソッドと非汎用のリスト
例:
List<int> numbers = new List<int>()
{
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
};
IEnumerable<int> evens = numbers.Where((x) =>
{
return x % 2 == 0;
});
IEnumerable<int> evens2 = numbers.Where<int>((x) =>
{
return x % 2 == 0;
});
なぜ他の上で1つを使用します(ジェネリックか非ジェネリック)?
明白な説明をありがとう! – infbubble