I have created following object model for my application
public class Object
{
public List<Node> Nodes { get; set; }
}
public class Node
{
public InstrumentData InstrumentData { get; set; }
}
public class InstrumentData
{
public List<MySysData> MySysDataList { get; set; }
}
public class MySysData
{
public string SystemName { get; set; }
}
Now I have Object list of nodes. I want to select not null "SystemName" from Object node list to a string list
I have tried following query but still its not has expected.
var test = Object.Nodes.ToList<Node>()
.Select(x => x.InstrumentData?.MySysDataList.ToList<MySysData>()
.Select(y => y.SystemName)
.ToList()) ;