fix(deployment): read every external system's methods in one query for the artifact snapshot (review 2026-10-21 04/P7)

This commit is contained in:
Joseph Doherty
2026-10-22 06:31:30 -04:00
parent 58b1e021b2
commit 669822772e
5 changed files with 102 additions and 5 deletions
@@ -1,5 +1,6 @@
using Microsoft.EntityFrameworkCore;
using ZB.MOM.WW.ScadaBridge.Commons.Entities.Deployment;
using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems;
using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances;
using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories;
using ZB.MOM.WW.ScadaBridge.Commons.Types.Deployment;
@@ -308,6 +309,17 @@ public class DeploymentManagerRepository : IDeploymentManagerRepository
return stale.Count;
}
/// <inheritdoc />
public async Task<IReadOnlyList<ExternalSystemMethod>> GetAllExternalSystemMethodsAsync(
CancellationToken cancellationToken = default)
{
return await _dbContext.Set<ExternalSystemMethod>()
.AsNoTracking()
.OrderBy(m => m.ExternalSystemDefinitionId)
.ThenBy(m => m.Id)
.ToListAsync(cancellationToken);
}
// --- DeployedConfigSnapshot ---
/// <inheritdoc />