title: Why isn't Razor/Blazor(WASM) page refreshing after update in both cases sending in two identical objects? (Cause: MudBlazor table module))
body: <p>Trying to shorten things down, one button has this code (takes the first vacant slot and updates the DB as not vacant):</p>
  <pre><code>@onclick=&quot;@(e =&gt; UpdateTimeSlot(@FirstVacantSlot, &quot;Booked&quot;, BookerGuid))&quot;
  </code></pre>
  <p>and the other button has this code (user picks a vacant spot):</p>
  <pre><code>@onclick=&quot;@(e =&gt; UpdateTimeSlot(@selectedItem, &quot;RowBooked&quot;, BookerGuid))&quot;
  </code></pre>
  <p>Calling after update:</p>
  <pre><code>protected override async Task OnParametersSetAsync()
  {
      await RefreshDb(); // get list of todays timeslots from DB 
      StateHasChanged(); // well, Blazor magic refresh or whatever
  }
  </code></pre>
  <p>FirstVacantSlot is set from a method that picks it from the DB.
  selectedItem is set when clicking a row in a (MudBlazor) table.
  Both get filled with the same type of data and send to the method UpdateTimeSlot.
  Both buttons correctly updates the DB, but the table refreshes ONLY after use of the first button, not after the second button. Why?
  Also, if I click the second button and then the first button the update no longer works there either.</p>
  <p><strong>Things I tried:</strong></p>
  <ul>
  <li>Debugged to see that the objects have identical values populated. Trying to follow whats happening.</li>
  <li>StateHasChanged() in every corner of the code.</li>
  <li>await this.OnParametersSetAsync() (Which makes the first button work)</li>
  </ul>
  <p><strong>Add; The UpdateTimeSlot method:</strong></p>
  <p>I substituted a call to RefreshDb() with the OnParameterAsync(). Still can't understand why it beahves differently depending on which button I click.</p>
  <pre><code>private async Task UpdateTimeSlot(TimeSlotDto vacantSlot, string title, Guid bookerId)
  {
      var updateTimeSlot = new TimeSlotDto();
      updateTimeSlot.ID = (Guid)vacantSlot.ID;
      updateTimeSlot.TimeSlotStart = vacantSlot.TimeSlotStart;
      updateTimeSlot.TimeSlotEnd = vacantSlot.TimeSlotEnd;
      updateTimeSlot.IsVacant = false;
      updateTimeSlot.CreatedUTC = vacantSlot.CreatedUTC;
      updateTimeSlot.Title = title;
      updateTimeSlot.UpdatedUTC = DateTime.UtcNow;
      updateTimeSlot.BookerId = bookerId;
      await _http.PutAsJsonAsync($&quot;https://localhost:44315/api/v1/TimeSlot/Update?id={updateTimeSlot.ID}&quot;, updateTimeSlot);
  
      //await this.OnInitializedAsync();
  
      await this.OnParametersSetAsync();
  }
  </code></pre>
  <p><strong>UPDATE</strong>
  The problem has been located to the MudBlazor component Table, which isn't updating correctly after selecting a row in the table itself. Everything else is working as it should; I tried a foreach-loop to iterate through the IENumerable currentTimeSlots, that the MudTable also is dependent on and the foreach-loop updated correctly. So I guess it's a completely different question now.</p>
  <p><strong>Update - RefreshDb()</strong></p>
  <pre><code>private async Task RefreshDb()
      {
          var roomClient = new RoomClient();
  
          room = await roomClient.GetRoomByIdAndDateAsync(ThisRoomId, dtToday);
  
          allTimeSlotsOfToday = room.TimeSlots;
          currentTimeSlots = allTimeSlotsOfToday.GetAllCurrentTimeSlots(dtToday);
          HasItems = currentTimeSlots.Count();
          FirstVacantSlot = allTimeSlotsOfToday.GetFirstVacant(dtToday);
          AnyVacantSlot = allTimeSlotsOfToday.Count(f =&gt; f.IsVacant);
      }
  </code></pre>
  <p><strong>Update:</strong>
  For some this might help:
  <a href="https://github.com/MudBlazor/MudBlazor/issues/3279" rel="nofollow noreferrer">MudBlazor MudTable issue on GitHub</a></p>