class Test { public delegate void FruitDelegate(Fruit f); public void Notify(Action del) where T : Fruit { FruitDelegate f = d
What about something like this?
public void Notify(Action del) where T : Fruit { FruitDelegate f = fruit => del((T)fruit); }
The FruitDelegate instance, when invoked, would throw an InvalidCastException if, say, an AppleHandler was invoked with a Banana argument.
FruitDelegate
AppleHandler
Banana