Discard in-memory changes when editing

This commit is contained in:
2025-12-26 10:04:37 -05:00
parent 77b5683804
commit 19a7164b8b
3 changed files with 21 additions and 3 deletions
@@ -103,8 +103,14 @@
}
}
private void HandleCancel()
private async Task HandleCancel()
{
// Discard all in-memory changes by reloading from database
if (Student != null)
{
await Context.Entry(Student).ReloadAsync();
}
_formChangeTracker?.AllowNavigation();
NavigationManager.NavigateTo(ReturnUrl ?? "/students");
}