I have used ObservableCollection
for DataBinding in my WPF
application where I am binding the collection to DataGrids
and ComboBoxes
. And due to a requirement, where I needed to remove objects from the collection based on a condition, I implemented the RemoveAll
functionality, like List
, using Extension method
.
This posts specifies a few merits of Inheritance
over Extension methods
but is not very specific for my case as this was the only method I needed to add and I don't intend to add another Extension method
for the Collection.
I would like to know if it would be better for me to have this implemented as Extension method
as is or should I think about inheriting the class and add it as a Instance method
?
Also, I would like to know if there is any performance difference between the two as it has not been discussed in the mentioned post.