I have a treenode collection as IEnumerable<treenode> nodes. Is there any method to create a collection of treenode.guid directly from nodes without iterating all the elements?
E.g.:
guidcollection nodeguids = nodes.somemethod();
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The answer is not – you obviously need to iterate through the collection of nodes if you need some info from each of them. However you can do something like:
This way you do not perform an iteration manually at least. Although implementation of
Selectinvolves iteration over all the elements of the collection, and it will be done at the moment you will try to use thenodeguidscollection somewhere.