Parent
has list of Children
. I only have access to the list of children. I need to get list of unique parents from the List of Children. Is there a better/faster/more efficient way of doing it than this?
var temp = new HashSet<Parent>(
(from child in program.Children
select child.Parent).ToList());
program.Children.Select(c => c.Parent).Distinct();
. It wont be any faster though. \$\endgroup\$