title: Async Fetch of Data when a Property Set in Blazor
body: <p>What is the proper way to fetch data from an async method when a property value changes?  Currently, I am doing something like this.</p>
  <pre><code>  &lt;form&gt;
        &lt;select class=&quot;form-control&quot; @bind=&quot;DayFilter&quot;&gt;
           &lt;option&gt;None&lt;/option&gt;
           &lt;option&gt;Monday&lt;/option&gt;
           &lt;option&gt;Tuesday&lt;/option&gt;
           &lt;option&gt;Wednesday&lt;/option&gt;
           &lt;option&gt;Thursday&lt;/option&gt;
           &lt;option&gt;Friday&lt;/option&gt;
           &lt;option&gt;Saturday&lt;/option&gt;
           &lt;option&gt;Sunday&lt;/option&gt;
         &lt;/select&gt;
    &lt;/form&gt;
  
  @code
  {
      private string dayFilter = NoDayFilter;
      private string DayFilter
      {
          get =&gt; dayFilter;
          set
          {
              dayFilter = value;
              _ = GetData();
          }
      }
  
  private async Task GetData()
  {
     ....
     StateHasChanged();
  }
  </code></pre>
  <p>}</p>
  <p>I am guessing this is not correct according to the <a href="https://docs.microsoft.com/en-us/aspnet/core/blazor/components/lifecycle?view=aspnetcore-3.1" rel="nofollow noreferrer">Blazor Docs</a>:</p>
  <blockquote>
  <p>Asynchronous work when applying parameters and property values must
  occur during the OnParametersSetAsync lifecycle event.</p>
  </blockquote>