refactor: ScadaBridge module options registration -> AddValidatedOptions; clarify De Morgan predicates
This commit is contained in:
@@ -39,11 +39,15 @@ public sealed class AuditLogOptionsValidator : OptionsValidatorBase<AuditLogOpti
|
||||
$"must be >= {nameof(AuditLogOptions.DefaultCapBytes)} ({options.DefaultCapBytes}); " +
|
||||
"the error-row cap is intended to capture more detail than the happy-path summary.");
|
||||
|
||||
// Valid when RetentionDays is within [Min, Max] inclusive. The De Morgan'd
|
||||
// guard !(below Min OR above Max) is equivalent to (>= Min AND <= Max).
|
||||
builder.RequireThat(
|
||||
!(options.RetentionDays < MinRetentionDays || options.RetentionDays > MaxRetentionDays),
|
||||
$"AuditLog:{nameof(AuditLogOptions.RetentionDays)} ({options.RetentionDays}) " +
|
||||
$"must be in [{MinRetentionDays}, {MaxRetentionDays}] days.");
|
||||
|
||||
// Valid when InboundMaxBytes is within [Min, Max] inclusive. The De Morgan'd
|
||||
// guard !(below Min OR above Max) is equivalent to (>= Min AND <= Max).
|
||||
builder.RequireThat(
|
||||
!(options.InboundMaxBytes < MinInboundMaxBytes || options.InboundMaxBytes > MaxInboundMaxBytes),
|
||||
$"AuditLog:{nameof(AuditLogOptions.InboundMaxBytes)} ({options.InboundMaxBytes}) " +
|
||||
|
||||
Reference in New Issue
Block a user