Discard in-memory changes when editing
This commit is contained in:
@@ -103,8 +103,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleCancel()
|
||||
private async Task HandleCancel()
|
||||
{
|
||||
// Discard all in-memory changes by reloading from database
|
||||
if (EventDefinition != null)
|
||||
{
|
||||
await context.Entry(EventDefinition).ReloadAsync();
|
||||
}
|
||||
|
||||
_formChangeTracker?.AllowNavigation();
|
||||
NavigationManager.NavigateTo("/events");
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -118,8 +118,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleCancel()
|
||||
private async Task HandleCancel()
|
||||
{
|
||||
// Discard all in-memory changes by reloading from database
|
||||
if (Team != null)
|
||||
{
|
||||
await Context.Entry(Team).ReloadAsync();
|
||||
}
|
||||
|
||||
_formChangeTracker?.AllowNavigation();
|
||||
NavigationManager.NavigateTo("/teams");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user