Associate List<T>.Remove to an event in C#?
- by Uri
Hi guys, I have a Products:List<Product> class.
I'd like to make it so that every time that I remove an item from that list, my program decreases a counter.
Is there a way to do it without overriding the Remove method or decreasing it manually? And if there is none, anybody knows where I can find the code for the Remove method?
Thanks!
I thought about associating the Remove method to an event, but I don't know how to do it without overriding it or creating another method with the Remove method inside it. Excuse me for my ignorance, but I'm just getting into OOP programming.