Skip to content

Instantly share code, notes, and snippets.

@kkoziarski
Created December 4, 2015 07:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkoziarski/3c4ff1b1f2565bedb02d to your computer and use it in GitHub Desktop.
Save kkoziarski/3c4ff1b1f2565bedb02d to your computer and use it in GitHub Desktop.
OperationAsync helper method
public async Task<TResult> OperationAsync<TResult>(Func<TResult> operation)
{
return await Task.Run(operation).ConfigureAwait(false);
}
public async Task<object> UsageExample()
{
return await this.OperationAsync(() => new object());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment