Skip to content

Instantly share code, notes, and snippets.

@fjod
Created August 6, 2020 09:48
Show Gist options
  • Save fjod/bde45e06341b0043e2b23ee7915a5a09 to your computer and use it in GitHub Desktop.
Save fjod/bde45e06341b0043e2b23ee7915a5a09 to your computer and use it in GitHub Desktop.
async void
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