Created
August 6, 2020 09:48
-
-
Save fjod/bde45e06341b0043e2b23ee7915a5a09 to your computer and use it in GitHub Desktop.
async void
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class TestBase | |
{ | |
protected abstract Task Impl(); | |
protected abstract void Impl2(); | |
} | |
public class Test : TestBase | |
{ | |
protected override Task Impl() | |
{ | |
Task.Run(() => | |
{ | |
//fire and forget | |
}); | |
return Task.CompletedTask; | |
} | |
protected override void Impl2() | |
{ | |
Task.Run(() => | |
{ | |
//fire and forget | |
}); | |
} | |
} | |
public class Test2 : TestBase | |
{ | |
protected override async Task Impl() | |
{ | |
await Task.Run(() => | |
{ | |
}); | |
} | |
protected override async void Impl2() | |
{ | |
await Task.Run(() => | |
{ | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment