Link to home
Create AccountLog in
Avatar of deleyd
deleydFlag for United States of America

asked on

Lambda with/without async

What is the difference between:
Task.Run(() => AsyncMethod());
Task.Run(async () => await AsyncMethod());

Open in new window

given some async method such as:
private async Task AsyncMethod()
{
    await Task.Delay(2000);
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of deleyd

ASKER

How about what's the difference between:
await Task.Run(() => AsyncMethod());
await Task.Run(async () => await AsyncMethod());

Open in new window

?