From 5de002bce52c00a739bada56d64e0ea88ed53115 Mon Sep 17 00:00:00 2001 From: aorzelskiGH Date: Wed, 20 Nov 2024 12:27:33 +0100 Subject: [PATCH] /submodels with DB First step Load all packages into memory --- .../Services/AdminShellPackageEnvironmentService.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/AasxServerStandardBib/Services/AdminShellPackageEnvironmentService.cs b/src/AasxServerStandardBib/Services/AdminShellPackageEnvironmentService.cs index d7fca3e6..ae96f169 100644 --- a/src/AasxServerStandardBib/Services/AdminShellPackageEnvironmentService.cs +++ b/src/AasxServerStandardBib/Services/AdminShellPackageEnvironmentService.cs @@ -573,6 +573,13 @@ public List GetSubmodelsByIdShort(string idShort) /// A list of all submodels. public List GetAllSubmodels() { + if (Program.withDb) + { + // workround to have submodels in memory + // will only work if all packages fit into memory + Program.LoadAllPackages(); + } + var output = new List(); foreach (var package in _packages)