From da1e93dd7f10b030b5f3bbcd977facbcb166ca28 Mon Sep 17 00:00:00 2001 From: "luca.weidmann@gmx.de" Date: Tue, 12 Nov 2024 16:01:47 +0100 Subject: [PATCH] [~] Fix no appzone created #2597 --- .../FWO.Services/ModellingAppZoneHandler.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/roles/lib/files/FWO.Services/ModellingAppZoneHandler.cs b/roles/lib/files/FWO.Services/ModellingAppZoneHandler.cs index 05e5e34fd..dd7794b18 100644 --- a/roles/lib/files/FWO.Services/ModellingAppZoneHandler.cs +++ b/roles/lib/files/FWO.Services/ModellingAppZoneHandler.cs @@ -27,20 +27,25 @@ public async Task CreateAppZones(string extAppId) } await DeleteExistingAppZones(owner.Id); - - ModellingAppZone appZone = new(); + + ModellingAppZone appZone = new() + { + AppId = owner.Id, + }; ApplyNamingConvention(owner.ExtAppId.ToUpper(), appZone); List appServers = await apiConnection.SendQueryAsync>(ModellingQueries.getAppServers, new { appId = owner.Id }); - List appServerWrappers = []; foreach (ModellingAppServer appServer in appServers) { - appServerWrappers.Add(new ModellingAppServerWrapper() { Content = appServer }); + appZone.AppServers.Add(new ModellingAppServerWrapper() { Content = appServer }); } - await AddAppZoneToDb(appZone); + int appZoneId = await AddAppZoneToDb(appZone); + + appZone.Id = appZoneId; + await AddAppServerToAppZone(appZone); } @@ -83,7 +88,7 @@ private void ApplyNamingConvention(string extAppId, ModellingAppZone appZone) appZone.Name = $"{NamingConvention.AppZone}{appZone.ManagedIdString.AppPart}"; } - private async Task AddAppZoneToDb(ModellingAppZone appZone) + private async Task AddAppZoneToDb(ModellingAppZone appZone) { try {