using Microsoft.Extensions.Options; namespace ZB.MOM.WW.ScadaBridge.DataConnectionLayer; /// Validates the MxGateway client identity before connections start. public sealed class MxGatewayGlobalOptionsValidator : IValidateOptions { /// Validates the MxGateway global options. /// The named-options instance being validated, or . /// The options to validate. /// A success result, or a failure naming the first invalid setting. public ValidateOptionsResult Validate(string? name, MxGatewayGlobalOptions options) { if (string.IsNullOrWhiteSpace(options.ClientNamePrefix)) return ValidateOptionsResult.Fail("ScadaBridge:MxGateway:ClientNamePrefix must not be blank."); return ValidateOptionsResult.Success; } }