Murali Poola
What are Action and Func keywords?
By Murali Poola in .NET on Apr 23 2012
  • Shankar M
    Nov, 2013 4

    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;

    • 0
  • Murali Poola
    Apr, 2012 23

    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 mInstance;
    Without having to declare the delegate type.  The Action<> delegate is the exact same thing, except for delegates that return void.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS