Executing synchronous methods asynchronously
We can achieve certain advantages by writing asynchronous methods. It's pretty simple to write them in C# code: we just need to use async and await keywords properly. Grammar of these keywords can be found in detail in MSDN . In this post I will try to focus on writing few code to invoke a regular synchronous method asynchronously. Let's assume a scenario where we need to perform an expensive database operation when a particular information is changed from the front end. For example: I have an application to manage employee information and I've changed the basic salary for a particular grade using my application. Now I need to update salary of all the employees under that grade. The later operation will be slower one and I don't want this to block me from doing other stuffs. Here is a piece of synchronous code to update salary information: public bool UpdateEmployeeSalary ( string grade ) { try ...