var result = from foo in foos from x in new string[] { foo, Reverse(foo) } select x;
or
var result = foos.SelectMany(foo => new string[] { foo, Reverse(foo) });
This maps each foo to a foos array, which consists of two elements: foo and Reverse(foo) . Then it combines all these two-element arrays into one big enumerated one.
{{{
"abc", {
"abc", "abc",
"cba", "cba",
},
"def", => {=>
"def", "def",
"fed", "fed",
}
"ghi", {
"ghi", "ghi",
"ihg", "ihg",
}
}}}
If the order of your output is not so important, you can also combine the source array with the result of matching each element in the source array using the callback method:
var result = foos.Concat(from foo in foos select Reverse(foo));
or
var result = foos.Concat(foos.Select(Reverse));
{{{
"abc", "abc", "abc",
"def", => "def", => "def",
"ghi", "ghi", "ghi",
}}
concat
{
"cba", "cba",
"fed", "fed",
"ihg", "ihg",
}}