yield return range
#3949
-
a lot of time, when parsing a graph, we have to return all the childs elements... IEnumerable GetNames() would be nice to have a yield return range |
Beta Was this translation helpful? Give feedback.
Answered by
HaloFour
Sep 27, 2020
Replies: 2 comments 3 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
333fred
-
In the meantime, you could also (in this case, at least), use: IEnumerable GetNames()
{
yield return Name;
foreach (var name in Childs.SelectMany(c => c.GetNames())
{
yield return name;
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#378