page 1 of 1
Comments: 4 | Views: 635

Is there some obvious reason it shouldn't that I'm not seeing? 

 

While we're at it, wouldn't it be nice if there were some way for me to have some existing class in an external assembly implement some interface without changing its code, a.k.a. extension interfaces a.k.a. typeclasses ... Tongue Out

TommyCarlier
TommyCarlier
I want my scalps!

This is an obvious reason: ICollection exists since .NET 1.0. IStructuralEquatable is new in .NET 4.

And not every collection has to be structurally equatable.

In fact, why should ICollection implement IStructuralEquatable?

While that's a nice interface, ICollection could hold any number of different types of objects. It doesn't make sense for it to implement IStructuralEquatable.

 

Just make a class that implements IEquatable and then reference it in the .Contains method (or wherever you're making the comparison).

page 1 of 1
Comments: 4 | Views: 635
Microsoft Communities