I’m trying to do this:
var collection1 = new Collection<string> {"one", "two"};
var collection2 = new Collection<string> {"three", "four"};
var result = collection1.Concat(collection2);
But the result variable is type Enumerable[System.String]
, whereas I want a Collection[System.String]
I’ve tried casting:
var all = (Collection<string>) collection1.Concat(collection2);
But no joy.
For some reason System.Collections.ObjectModel.Collection requires an IList parameter to it’s constructor. (The other collections only need an
IEnumerator)