简体   繁体   中英

c# linq search with nested list and struct

i have a struct

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

and 2 lists

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

if i want a List<one_point> result which is a list of all the points with a _value less than 50

how do i query it ? something like ;

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

在对列表进行任何条件检查之前,将其弄平。

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM