title: Using System.Timers.Timer Elapsed with DBContext never get updated
body: <p>Hi I am using the following code with <code>System.Timers.Timer</code> but the event triggered by the <code>Elapsed</code> event method uses my <code>DBContext</code> injected by the DI and in the background the record is updated in the database but the <code>DBContext</code> doesn't seem to be getting the latest change.</p>
  <p>Do I need to configure <code>DBContext</code> to not cache or something else?</p>
  <pre><code>private System.Timers.Timer aTimer;
  private Stopwatch stopWatch;
  
  //MAIN CODE
  aTimer = new System.Timers.Timer
  {
      Interval = _settings.RetryIntervalsInSeconds * 1000
  };
  stopWatch = Stopwatch.StartNew();
  // Hook up the Elapsed event for the timer. 
  aTimer.Elapsed += async (sender, e) =&gt;
      await VerifyRecordIsUpdatedAsync(sender, e, record.Id);
  
  // Have the timer fire repeated events (true is the default)
  aTimer.AutoReset = true;
  
  // Start the timer
  aTimer.Start();
  
  while (aTimer.Enabled)
  {
      var timeRetryExecuting = stopWatch.Elapsed;
      if (timeRetryExecuting.Seconds &gt; _settings.TimeoutWaitingInSeconds)
      {
          aTimer.Stop();
      }
  }
  
  // EVENT METHOD
  private async Task VerifyRecordIsUpdatedAsync(object sender, 
      ElapsedEventArgs e, Guid recordId)
  {
      var record = await _context.Records.FirstOrDefaultAsync(x =&gt; x.Id == recordId);
      var timeRetryExecuting = stopWatch.Elapsed;
      if (record.Status != Status.Pending
          || timeRetryExecuting.Seconds &gt; _settings.TimeoutWaitingInSeconds)
      {
          aTimer.Stop();
          stopWatch.Stop();
      }
  }
  </code></pre>