Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MichalGrzegorzak/ed506ee821bf8a4bc0570bbc8b4c3788 to your computer and use it in GitHub Desktop.
Save MichalGrzegorzak/ed506ee821bf8a4bc0570bbc8b4c3788 to your computer and use it in GitHub Desktop.
C# - Call an async method on the constructor

C#

Call an async method on the contructor and wait for it's execution

Task.Run(() => this.FunctionAsync()).Wait();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment