Skip to content

NH-4036 - Cleanup old non generic enumerable interface #892

Open
@nhibernate-bot

Description

@nhibernate-bot

Frédéric Delaporte created an issue — 20th June 2017, 19:59:11:

In most cases, interfaces still exposing non generic enumerable such as IEnumerable, ICollection, IList, IDictionary are remnants of .Net Framework 1.1.

It is about time to move them to generic interfaces, at worst IEnumerable<object> for cases where it proves unpractical to introduce a generic type parameter.

The main drawbacks of keeping usages of non-generic enumerable are:

  • Their IEnumerator are not disposable, though most of the time the underlying implementation will be. This constrains to try cast to IDisposable them for ensuring disposing any underlying disposable.
  • They have far less extension methods for Linq manipulation, regularly causing code like .Cast<object>() to be used on them for converting them to IEnumerable<object>.
  • We maintain some custom EnumerableExtensions, CollectionHelper, ArrayHelper, CollectionPrinter, EnumeratorAdapter only for them.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions