Last active
July 21, 2018 08:13
-
-
Save idiotandrobot/ca87bfb9d236e4103cdef75957289a59 to your computer and use it in GitHub Desktop.
async/await in Windows Runtime Components
This file contains 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 DoSomethingAsync() | |
{ | |
await SomethingElseAsync(); | |
} | |
public async Task<Foo> DoAnotherAsync() | |
{ | |
return await ReturnAFooAsync(); | |
} |
This file contains 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 IAsyncAction GetDoSomethingAsync() | |
{ | |
return DoSomethingAsync().AsAsyncAction(); | |
} | |
internal async Task DoSomethingAsync() | |
{ | |
await SomethingElseAsync(); | |
} | |
public IAsyncOperation<Foo> GetDoAnotherAsync() | |
{ | |
return DoAnotherAsync().AsAsyncOperation(); | |
} | |
internal async Task<Foo> DoAnotherAsync() | |
{ | |
return await ReturnAFooAsync(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment