If I have a normal method that I want to make asynchronous:
public int Foo(){}
I would do:
public Task<int> FooAsync(){
return Task.Run(() => Foo());
}
Why would I do:
public async Task<int> FooAsync(){
return await Task.Run(() => Foo());
}
The way I plan to use this is:
FooAsync().ContinueWith((res) => {});
I want the method to just run without stopping, but I want something like a callback to be fired, hence the ContinueWith
. But with the second version, is there a point to using it?