Have you been used an application that freeze when you click on a button? This is because the application is retrieving data from a database and that execution takes some time and during that time the application stop responding. To avoid this situation, you should use asynchronous programming in your code. This let’s your user to continue to use the application while he is doing tasks in the background.
Synchronous operation VS Asynchronous operation
When a synchronous operation execute a long running operation on the UI thread (your application interface) it will lock up the application.
An asynchronous operation occurs in parallel and relieves the calling thread of the work.
The new keywords « async » and « await » allow you to program asynchronous methods for you application and create and handle threads for you to help you keep your code simple.
The « await » keyword will pause the execution of the method until a result is available, without blocking the calling (UI) thread.