diff --git a/.idea/.idea.HopFrame/.idea/workspace.xml b/.idea/.idea.HopFrame/.idea/workspace.xml
index 021c34d..d897a72 100644
--- a/.idea/.idea.HopFrame/.idea/workspace.xml
+++ b/.idea/.idea.HopFrame/.idea/workspace.xml
@@ -11,7 +11,11 @@
-
+
+
+
+
+
@@ -32,7 +36,7 @@
@@ -56,23 +60,24 @@
+
+
+
+
+
+
-
-
-
-
-
{}
{
@@ -101,7 +106,7 @@
"RunOnceActivity.git.unshallow": "true",
"b5f11219-dfc4-47a1-b02c-90ab603034fb.executor": "Debug",
"dcdf1689-dc07-47e4-8824-2e60a4fbf301.executor": "Debug",
- "git-widget-placeholder": "!24 on fix/relations",
+ "git-widget-placeholder": "!26 on fix/cancellabe-relations",
"list.type.of.created.stylesheet": "CSS",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
@@ -207,7 +212,8 @@
-
+
+
@@ -433,7 +439,15 @@
1738062559567
-
+
+
+ 1738063028173
+
+
+
+ 1738063028173
+
+
@@ -484,7 +498,6 @@
-
@@ -509,6 +522,7 @@
-
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index d655ccd..bbd832b 100644
--- a/README.md
+++ b/README.md
@@ -72,6 +72,12 @@ builder.Services.AddHopFrame(options => {
});
```
+Then you need to map the frontend pages in your application:
+
+```csharp
+app.MapHopFrame();
+```
+
### Usage
- Navigate to `/admin` to access the admin dashboard and start managing your tables.
diff --git a/src/HopFrame.Core/Services/Implementations/TableManager.cs b/src/HopFrame.Core/Services/Implementations/TableManager.cs
index d002512..0067271 100644
--- a/src/HopFrame.Core/Services/Implementations/TableManager.cs
+++ b/src/HopFrame.Core/Services/Implementations/TableManager.cs
@@ -2,6 +2,7 @@
using System.ComponentModel.DataAnnotations;
using HopFrame.Core.Config;
using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.ChangeTracking;
namespace HopFrame.Core.Services.Implementations;
@@ -49,7 +50,14 @@ internal sealed class TableManager(DbContext context, TableConfig config
}
public async Task RevertChanges(object item) {
- await context.Entry((TModel)item).ReloadAsync();
+ var entry = context.Entry((TModel)item);
+ await entry.ReloadAsync();
+
+ if (entry.Collections.Any()) {
+ context.ChangeTracker.Clear();
+ }
+
+ await context.SaveChangesAsync();
}
private bool ItemSearched(TModel item, string searchTerm) {
diff --git a/src/HopFrame.Web/Components/Dialogs/HopFrameEditor.razor b/src/HopFrame.Web/Components/Dialogs/HopFrameEditor.razor
index 64eb657..e014499 100644
--- a/src/HopFrame.Web/Components/Dialogs/HopFrameEditor.razor
+++ b/src/HopFrame.Web/Components/Dialogs/HopFrameEditor.razor
@@ -1,5 +1,5 @@
-@implements IDialogContentComponent
@rendermode InteractiveServer
+@implements IDialogContentComponent
@using System.Collections
@using HopFrame.Core.Config
diff --git a/src/HopFrame.Web/Components/Pages/HopFrameTablePage.razor b/src/HopFrame.Web/Components/Pages/HopFrameTablePage.razor
index e7b1538..81b99d7 100644
--- a/src/HopFrame.Web/Components/Pages/HopFrameTablePage.razor
+++ b/src/HopFrame.Web/Components/Pages/HopFrameTablePage.razor
@@ -249,6 +249,7 @@
if (result.Cancelled) {
if (data?.CurrentObject is not null)
await _manager!.RevertChanges(data.CurrentObject);
+ await Reload();
return;
}