我有一個List OS複雜類型中獲取特定對象領域,比方說一系列
public class Point {
public double X;
public int Id;
}
List<Point> points = (...);
我如何獲得的所有Id
的List<int>
在一定範圍內使用LINQ,說(minIndex, maxIndex)
?
我可以通過points.getRange(minIndex, maxIndex - maxIndex)
獲得所有點對象,但是如何才能獲得Id
字段的列表?
,因爲我從使用'GetRange'你有興趣看在「Point」的索引中,而不在ID的值範圍內?=!我對嗎? –