title: Providing Synchronous and Asynchronous Versions of Method in C#
body: <p>I am writing an API in C# and I want to provide both synchronous and asynchronous versions of the publicly available methods.
  For example, if I have the following function:</p>
  
  <pre><code>public int MyFunction(int x, int y)
  {
     // do something here
     System.Threading.Thread.Sleep(2000);
     return  x * y;
  
  }
  </code></pre>
  
  <p>how can I create an asynchronous version of the above method (perhaps BeginMyFunction and EndMyFunction)?  Are there different ways to achieve the same result, and what are the benefits of the various approaches?</p>