I have a class just like the following:
public class ParentData
{
public List<ChildData> ChildDataList { get; set; }
public ChildData AnotherChildData { get; set; }
}
I am looking for a simple Linq query to make a selection from these 2 members. Here is what I actually do:
var query = (from data in parentData.ChildDataList select data)
.Union
(from data in new List<ChildData> { parentData.AnotherChildData } select data);
Is there a better way to do this? Thank you.