public class Buddy
{
public string[] Sayings;
}
Buddy one = new Buddy();
one.Sayings = new[] {"cool", "wicked", "awesome"};
Buddy two = new Buddy();
two.Sayings = new[] {"bad", "lame", "boring"};
Buddy[] buddies = new[] {one, two};
IEnumerable<string[]> something =
from b in buddies
select b.Sayings;
So basically I would like to get a single array or list that contains {"cool, wicked, awesome, "bad", "lame", "boring"} the sayings for each Buddy using linq.
I tried everything I could think of and am starting to doubt it can be done with just a single linq expression. I could go through each buddy in buddies and do an addrange on the Sayings into a list but I figured since I am learning linq I would try it this way. Is it possible and if so how? This could also apply if I wanted to get some other objects inside of a Buddy in this case its just the list of strings.