Apologizing in advance for the newbie kinda question (as I am one in C#):
While studying delegates, it seems to me that the combination of Action
and Func
covers the entire "functionality" of the delegate
keyword.
In other words, there is nothing that you can do with the delegate
keyword but cannot do with either Action
or Func
.
I've tried the following examples (which work fine):
Func<int,int,int,int> func = (x,y,z) => (x<<9)|(y<<6)|(z<<3);
Action<int,int,int> action = (x,y,z) => Console.WriteLine(x|y|z);
Am I wrong? If yes, then can you please provide a counterexample?