Created
December 4, 2015 07:30
-
-
Save kkoziarski/3c4ff1b1f2565bedb02d to your computer and use it in GitHub Desktop.
OperationAsync helper method
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 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