I've that a C# array implements IEnumerable so the compiler has no complaints converting:
string[] array = new string[1];
IEnumerable<string> collection = array;
However when I have both wrapped in tasks, I get an error. Why is this not possible?
Task<string[]> arrayTask = Task.FromResult(new string[1]);
Task<IEnumerable<string>> collectionTask = arrayTask;
Here's the compile error I get (where T is the type):
Cannot implicitly convert type 'System.Threading.Tasks.Task<T[]>' to 'System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<T>>