2016-04-11 5 views
0

Ich habe eine StrukturC# Linq Suche mit verschachtelten Liste und struct

public struct one_point 
{ 
    public int X { get; set; } 
    public int Y { get; set; } 
    public int _value{ get; set; } 
} 

und 2 Listen

List<one_point> rotation_list = new List<one_point>(); 
List<List<one_point>> Full_list = new List<List<one_point>>(); 

wenn ich will ein List<one_point> result , die eine Liste aller Punkte mit einem _value weniger als 50

wie frage ich es? etwas wie ;

IEnumerable<one_point> result = Full_list.Where(y => y.SelectMany(z => z._value < 50)); 

Antwort

1

Flatten die Liste vor auf sie keine bedingten Kontrollen machen.

IEnumerable<one_point> result = Full_list.SelecetMany(x => x).Where(x => x._value < 50);