I've got the following code.
Task.Run(() => StartAsync())
public void StartAsync() { }
Which works fine, but I want to supply a method definition instead.
Task.Run(StartAsync) // Compiler refuses this
The ContinueWith
method allows method definitions, so I'm wondering why the Run
method doesn't.
Task.Run(() => StartAsync()).ContinueWith(HandleException);
public void StartAsync() { }
public void HandleException(Task task) { }