I have a collection of generic Tasks those are marked for execution. As and when a task complete (using Task.WaitAny
), I am adding it to an ObservableCollection
.
But, the issue is at Task.WaitAny(...)
line, which says Co-variant array conversion from Task<MyType>[] to Task[] can cause run-time exception on write operation.
I am fairly knowledgeable on what this exception means and why it complains at this stage.
Question: Is there any generic version of Task.WaitAny()
, which can take Task<T>
as parameter instead of Task[]
.
Thanks in advance.