From 210ce072f8e855b20d025151afea69702cc32c58 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Thu, 20 Mar 2025 17:01:13 +0100 Subject: [PATCH] refactor(AnnotationParams): vereinfacht --- EnvelopeGenerator.Web/Models/AnnotationParams.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/EnvelopeGenerator.Web/Models/AnnotationParams.cs b/EnvelopeGenerator.Web/Models/AnnotationParams.cs index 68997f6e..70410e17 100644 --- a/EnvelopeGenerator.Web/Models/AnnotationParams.cs +++ b/EnvelopeGenerator.Web/Models/AnnotationParams.cs @@ -19,9 +19,6 @@ public class AnnotationParams return annotation is not null; } - [JsonIgnore] - public IEnumerable Names => _annots.Select(annot => annot.Name); - public required IEnumerable Annotations { get => _annots; @@ -33,20 +30,20 @@ public class AnnotationParams foreach (var annot in _annots) annot.Default = DefaultAnnotation; - foreach (var name in Names) + foreach (var annot in _annots) { #region set bound annotations // horizontal - if (this[name].HorBoundAnnotName is string horBoundAnnotName) + if (annot.HorBoundAnnotName is string horBoundAnnotName) if (TryGet(horBoundAnnotName, out var horBoundAnnot)) - this[name].HorBoundAnnot = horBoundAnnot; + annot.HorBoundAnnot = horBoundAnnot; else throw new InvalidOperationException($"{horBoundAnnotName} added as bound anotation. However, it is not defined."); // vertical - if (this[name].VerBoundAnnotName is string verBoundAnnotName) + if (annot.VerBoundAnnotName is string verBoundAnnotName) if (TryGet(verBoundAnnotName, out var verBoundAnnot)) - this[name].VerBoundAnnot = verBoundAnnot; + annot.VerBoundAnnot = verBoundAnnot; else throw new InvalidOperationException($"{verBoundAnnotName} added as bound anotation. However, it is not defined."); #endregion