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