title: What is 'context.Wait' use for in BotFramework
body: <p>I use the BotFramework to realize a bot, and I use the interface IDialog.
  In the Dialog, call EchoDialog, the main code is below:</p>
  
  <pre><code>public Task StartAsync(IDialogContext context)
      {
          context.Wait(MessageReceivedAsync);
          return Task.CompletedTask;
      }
  
      private async Task MessageReceivedAsync(IDialogContext context, IAwaitable&lt;IMessageActivity&gt; result)
      {
          var activity = await result;
          await context.PostAsync($"{count++},You said: " + activity.Text);
          context.Wait(MessageReceivedAsync);
      }
  </code></pre>
  
  <p>and the MessagesController.cs main code:</p>
  
  <pre><code> public async Task&lt;HttpResponseMessage&gt; Post([FromBody]Activity activity)
      {
          if (activity.Type == ActivityTypes.Message)
          {
              await Conversation.SendAsync(activity, () =&gt; new EchoDialog());
          }
          var response = Request.CreateResponse(HttpStatusCode.OK);
          return response;
      }
  </code></pre>
  
  <p>The code run well. But if I comment the code(in the EchoDialog.cs,in function MessageReceivedAsync):</p>
  
  <pre><code>context.Wait(MessageReceivedAsync);
  </code></pre>
  
  <p>The code run result is the same as the uncommented result, that is it can still echo what use input.</p>
  
  <p>So what is <code>context.Wait</code> indeed use for?</p>