Call your method as following:
await Task.Run(() => YourMethod());
When you use the Task.Run method it creates an awaitable task for you.
Call your method as following:
await Task.Run(() => YourMethod());
When you use the Task.Run method it creates an awaitable task for you.