Is the CollectionBase class still supported?

前端 未结 2 600
清酒与你
清酒与你 2020-12-09 20:51

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

2条回答
  •  失恋的感觉
    2020-12-09 21:19

    Linq extensions are written for IEnumerable (Generic) and CollectionBase (Non-generic) does not inherit from it. That is why you are not able to use Linq on it.

    Use System.Collections.ObjectModel.Collection instead.

提交回复
热议问题