A delegate referencing a method that "returns" void
is called an Action
in .NET lingo, and that's what the delegate type is called as well:
So your method signature would be this:
public static void DeleteSingleItemInDataGrid
(DataGrid dataGrid, String IDcolumnName, Action afterCompletionMethod_ToRun)
If you need to pass the int
parameter to it, and not return int
, it would be this:
public static void DeleteSingleItemInDataGrid
(DataGrid dataGrid, String IDcolumnName, Action<int> afterCompletionMethod_ToRun)
This accepts a method taking an int
parameter, that does not return anything (aka "returning" void
).
This also means that you cannot create a generic method that accepts both methods returning something and methods not returning something with just one method, but need to create an overload using Action
, and one using Func<T>
.
Action
in stead – Sass