title: C# async/await for I/O-Bound vs CPU-Bound operation
body: <p>I am learning about asynchronous programming in C#. In <a href="https://docs.microsoft.com/en-us/dotnet/csharp/async" rel="noreferrer">this</a> article I found that for IO-Bound operations you should not use Task.Run() but I don't know how to create a task without Task.Run()... For example I want to create a custom method named GetPageCountAsync, which query database and return results. I have method GetPageCount already which query database synchronous. I don't know better way than:</p>
  
  <pre><code>private async Task&lt;int&gt; GetPageCountAsync()
  {
    return await Task.Run(() =&gt; GetPageCount());
  }
  </code></pre>
  
  <p>How to do this without Task.Run? I found a ExecuteReaderAsync method of SqlCommand class but I wonder how is this method implemented? Without Task.Run? If so, how?</p>