A
andrew.miadowicz
It's funny that I've only now run into this question, after a few years
of using C#, but I find it intriguiging all the same. All the more so,
that the generic version of ICollection in .Net Framework 2.0 has this
method.
It seems to me that the question whether a collection has some element
should be answerable by any collection, not just IList or IDictionary.
An obvious implementation must exist, since every ICollection inherits
IEnumerable.
I ran into the problem, where I wanted to use a collection as general
as possible (i.e. not limiting the user to go down the IList or
IDictionary path), but I need to tell whether it contains a certain
object. I can implement it myself, but wouldn't it be easier if
ICollection simply provided a method.
Does anyone have any comments? Are there any plans to add this method
in .Net Framework 2.0?
Thanks,
Andrew
of using C#, but I find it intriguiging all the same. All the more so,
that the generic version of ICollection in .Net Framework 2.0 has this
method.
It seems to me that the question whether a collection has some element
should be answerable by any collection, not just IList or IDictionary.
An obvious implementation must exist, since every ICollection inherits
IEnumerable.
I ran into the problem, where I wanted to use a collection as general
as possible (i.e. not limiting the user to go down the IList or
IDictionary path), but I need to tell whether it contains a certain
object. I can implement it myself, but wouldn't it be easier if
ICollection simply provided a method.
Does anyone have any comments? Are there any plans to add this method
in .Net Framework 2.0?
Thanks,
Andrew