From 5a56125444f63eb0bf659a58a544507ebedcb569 Mon Sep 17 00:00:00 2001 From: TekH Date: Wed, 10 Dec 2025 13:52:16 +0100 Subject: [PATCH] Add PropertyNames property to EntityBaseOptions Introduce PropertyNames as a read-only property exposing the keys of ColumnMappings. Refactor EnsureProperties to use PropertyNames for improved clarity and maintainability. --- src/ReC.Infrastructure/Options/Shared/EntityBaseOptions.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ReC.Infrastructure/Options/Shared/EntityBaseOptions.cs b/src/ReC.Infrastructure/Options/Shared/EntityBaseOptions.cs index c9d343f..e7c94c6 100644 --- a/src/ReC.Infrastructure/Options/Shared/EntityBaseOptions.cs +++ b/src/ReC.Infrastructure/Options/Shared/EntityBaseOptions.cs @@ -6,9 +6,11 @@ public record EntityBaseOptions() { public Dictionary ColumnMappings { get; init; } = []; + public IEnumerable PropertyNames => ColumnMappings.Select(col => col.Key); + public void EnsureProperties(IEnumerable propertyNames) { - var missingProperties = propertyNames.Except(ColumnMappings.Select(col => col.Key)).ToList(); + var missingProperties = propertyNames.Except(PropertyNames).ToList(); if (missingProperties.Count != 0) throw new InvalidOperationException($"The following properties are not configured: {string.Join(", ", missingProperties)}");