collectionbase

Is the CollectionBase class still supported?

心已入冬 提交于 2019-11-28 09:17:53
I want to create a class that inherits from CollectionBase , but it seems that it does not support LINQ extensions! Is it still supported? Or is there an alternative solution? It is still supported , but it is obsolete. You should always prefer to use the collections defined in the System.Collections.Generic or the System.Collections.ObjectModel namespaces, instead. You can inherit from one of the generic collections to create your own custom, strongly-typed collection, as well. And it will have full support for LINQ, since they already implement IEnumerable<T> . Either List<T> or Collection<T

Is the CollectionBase class still supported?

江枫思渺然 提交于 2019-11-27 02:54:29
问题 I want to create a class that inherits from CollectionBase, but it seems that it does not support LINQ extensions! Is it still supported? Or is there an alternative solution? 回答1: It is still supported , but it is obsolete. You should always prefer to use the collections defined in the System.Collections.Generic or the System.Collections.ObjectModel namespaces, instead. You can inherit from one of the generic collections to create your own custom, strongly-typed collection, as well. And it