I have an ObservableCollection which I’m changing to an array using string[] s = myObservableCollection.ToArray();This works fine. I noticed, however, that VS does not offer that in its auto-complete. It only offers ToArray<> . So I wonder – does this mean it’s not supported in all cases or platforms etc. ?
I have an ObservableCollection which I’m changing to an array using string[] s =
Share
If it compiles, it is supported.
Intellisense is not perfect and relying on it too much is a mistake. As you have seen, a perfectly valid option didn’t come up.
In this case, the method is probably the
IEnumerable<T>.ToArray()extension method provided by LINQ.