static void Main()
{
Action<string> myAction = SomeMethod;
myAction("Hello World");
myAction.Invoke("Hello World");
}
static void SomeMethod(string someString)
{
Console.WriteLine(someString);
}
The output for the above is:
Hello World
Hello World
Now my question(s) is
What is the difference between the two ways to call the Action, if any?
Is one better than the other?
When use which?
Thanks
See Question&Answers more detail:os