Skip to content

Instantly share code, notes, and snippets.

@kevingosse
Last active December 25, 2020 07:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kevingosse/20936a96e3b5177a0f224a470870a04e to your computer and use it in GitHub Desktop.
Save kevingosse/20936a96e3b5177a0f224a470870a04e to your computer and use it in GitHub Desktop.
interface IInterface
{
void DoSomething();
}
class Implementation : IInterface
{
public void DoSomething()
{
// This method can't return a Task,
// delegate the async code to another method
_ = DoSomethingAsync();
}
private async Task DoSomethingAsync()
{
await Task.Delay(100);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment