c# when action is not void
Imagine that we're passing have a method that accept Action as a parameter.
public void Invoke(Action action)
{ /*Code Here */ }
And if we pass something like this
public void Invoke(Action action){ /*Code Here */ }
public void WriteSomething() { Console.WriteLine('test'); }
In reality we're passing void back which is wrong. We should invoke it like so,
Invoke(() => { /* code here */ }
Invoke(() => { UpdateSomething(localVar1, localVar2, localVar3); }
Comments