Answer the question
In order to leave comments, you need to log in
How to convert a collection of objects to a collection of the values of one of its properties in one line?
for example, there is a List, and I need to get the List from the values of its Text property. How to do it in one line? Thank you.
Answer the question
In order to leave comments, you need to log in
source.Select(c=>с.Text).ToList()
или
var t = from c in source
select c.Text
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question