An example of use of the observer design pattern in c sharp
This is my implementation of the observer design pattern using C#. I created a simple example using an event and a delegate.
The TicketSeller object (that has the purpose to sell tickets) has an event named OnSale. You can subscribe to this event in order to be notified when the tickets are on sale.
How to subscribe? (lambda syntax)
or using other different syntaxes
How to test it? As soon as the status of the tickets goes on sale you will be notified..