What is the best way to convert from a generic IEnumerable object to an array of the same type? The current solution I have looks like the following:
IEnumerable<string> foo = getFoo();
string[] bar = new List<string>(foo).ToArray();
The transfer through a List<T> seems unneccesary, but I haven't been able to find a better way to do it.
Note: I'm working in C# 2.0 here.