var result = Task.Run(async() => { return await yourAsyncMethod(); }).Result;
This is best solution for wait until your async call complete
There are other solutions which you can try
YourAsyncMethod().GetAwaiter().GetResult();
or
YourAsyncMethod().Result;
No comments:
Post a Comment