diff --git a/src/ReC.Infrastructure/Options/Shared/EntityBaseOptions.cs b/src/ReC.Infrastructure/Options/Shared/EntityBaseOptions.cs index d0b8e7c..74b0188 100644 --- a/src/ReC.Infrastructure/Options/Shared/EntityBaseOptions.cs +++ b/src/ReC.Infrastructure/Options/Shared/EntityBaseOptions.cs @@ -1,4 +1,6 @@ -namespace ReC.Infrastructure.Options.Shared; +using ReC.Domain.Attributes; + +namespace ReC.Infrastructure.Options.Shared; public record EntityBaseOptions() { @@ -13,5 +15,14 @@ public record EntityBaseOptions() } public void EnsureProperties(params string[] propertyNames) - => EnsureProperties(propertyNames.AsEnumerable()); + => EnsureProperties(propertyNames.AsEnumerable()); + + public void EnsureProperties() + { + var propertyNames = typeof(T) + .GetProperties() + .Where(prop => Attribute.IsDefined(prop, typeof(MustConfiguredAttribute))) + .Select(prop => prop.Name); + EnsureProperties(propertyNames); + } } \ No newline at end of file