title: Async/ Await: why does the code that follows await is also executed on the background thread and not on the original primary thread?
body: <p>Below is my code:</p>
  <pre><code>class Program
  {
      static async Task Main(string[] args)
      {
          Console.WriteLine(Thread.CurrentThread.ManagedThreadId);
          string message = await DoWorkAsync();
          Console.WriteLine(Thread.CurrentThread.ManagedThreadId);
          Console.WriteLine(message);
      }
  
      static async Task&lt;string&gt; DoWorkAsync()
      {
          return await Task.Run(() =&gt;
          {
              Thread.Sleep(3_000);
              return &quot;Done with work!&quot;;
          });
      }
  }
  </code></pre>
  <p>and the output is</p>
  <blockquote>
  <p>1</p>
  </blockquote>
  <p>// after 3 secs</p>
  <blockquote>
  <p>3</p>
  <p>Done with work!</p>
  </blockquote>
  <p>so you can see the main thread(id is 1) changed to worker thread(id is 3), so how come the main thread just disappear?</p>