From ffa24dbecc9269c2dd0ecf2dd59ae2dd64ce8da5 Mon Sep 17 00:00:00 2001 From: Pat Hartl Date: Tue, 28 Nov 2023 17:56:16 -0600 Subject: [PATCH] Fix game deletions not working due to relationship with game saves, save paths, and play sessions --- LANCommander/Data/DatabaseContext.cs | 68 +- LANCommander/Data/ModelBuilderExtensions.cs | 23 + LANCommander/Data/Models/BaseModel.cs | 3 + LANCommander/Data/Models/GameSave.cs | 2 +- LANCommander/Data/Models/PlaySession.cs | 2 +- ...128214406_FixDeletionBehaviors.Designer.cs | 1804 +++++++++++++++++ .../20231128214406_FixDeletionBehaviors.cs | 975 +++++++++ .../DatabaseContextModelSnapshot.cs | 123 +- LANCommander/Pages/Profile/Saves.razor | 4 +- 9 files changed, 2938 insertions(+), 66 deletions(-) create mode 100644 LANCommander/Data/ModelBuilderExtensions.cs create mode 100644 LANCommander/Migrations/20231128214406_FixDeletionBehaviors.Designer.cs create mode 100644 LANCommander/Migrations/20231128214406_FixDeletionBehaviors.cs diff --git a/LANCommander/Data/DatabaseContext.cs b/LANCommander/Data/DatabaseContext.cs index 4c8de21..7ff2b38 100644 --- a/LANCommander/Data/DatabaseContext.cs +++ b/LANCommander/Data/DatabaseContext.cs @@ -17,6 +17,25 @@ namespace LANCommander.Data { base.OnModelCreating(builder); + builder.ConfigureBaseRelationships(); + builder.ConfigureBaseRelationships(); + builder.ConfigureBaseRelationships(); + builder.ConfigureBaseRelationships(); + builder.ConfigureBaseRelationships(); + builder.ConfigureBaseRelationships(); + builder.ConfigureBaseRelationships(); + builder.ConfigureBaseRelationships(); + builder.ConfigureBaseRelationships(); + builder.ConfigureBaseRelationships(); + builder.ConfigureBaseRelationships(); + builder.ConfigureBaseRelationships(); + builder.ConfigureBaseRelationships(); + builder.ConfigureBaseRelationships