I\'m stuck, why isn\'t this working:
var childAction = new Action(blabla);
Action upperAction = (Action
This is contravariance. This isn't working, because if this will be possible, you could write something like this:
interface IDomainCommand { }
class CancelCommand : IDomainCommand { }
class AcceptCommand : IDomainCommand { }
Action a1 = c => { };
Action a2 = a1;
var acceptCommand = new AcceptCommand();
a2(acceptCommand); // what???
a2
points to a1
, and a1 can't accept AcceptCommand
argument, because it is not a CancelCommand
.