I would like to get data with linq from ilist which has type of one class - for example - iList - everything I know, that in this iList are saved emails and names, but this iList has no string type, but this class. How can I get them? It would be great to put this data to my own List Any hint how to do that?
IList<MyNameAndEmailClass> myList = GetMyList();
var emailList = myList.Select(x => x.EmailAddress).ToList();
emailList will now contain only the email addresses.
Is this what you want?
var result = list.OfType<SomeType>()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With