Interviews2 answers
What are Action and Func keywords?
2 Answers
Action and Func are Generic Delegates in C#
Action is a generic Delegate that does not accept any Paramter Input not returns a value.
Func is a generic Delegate that accepts Input Parameter and has a return type.
General form :
Func myFuncDel;
Shankar MPosted Nov 4, 2013, 6:36 PM EST
They are
generic types that help cut down on delegate type declarations. Whereas
previously, you'd have to declare your own delegate type for, say, this
delegate:
public delegate int MyDelegate(int arg1, double arg2, string arg3);
public MyDelegate mInstance;
You can now declare
the instance like this:
public Func
Without having
to declare the delegate type. The Action<> delegate is the exact
same thing, except for delegates that return void.
Murali PoolaPosted Apr 22, 2012, 11:57 PM EDT

