src/GenFx/Validation/ComponentValidatorExtensions.cs
/// <summary>
/// Checks whether the property is valid.
/// </summary>
/// <param name="validator"><see cref="ComponentValidator"/> to perform the validation.</param>
/// <param name="component">The <see cref="GeneticComponent"/> to be validated.</param>
Checks whether the property is valid.
Checks whether the property is valid .
public static void EnsureIsValid(this ComponentValidator validator, GeneticComponent component)
        {
            if (validator == null)
            {
                throw new ArgumentNullException(nameof(validator));
            }
            if (component == null)
            {
                throw new ArgumentNullException(nameof(component));
            }
            string? errorMessage;
            if (!validator.IsValid(component, out errorMessage))
            {
                throw new ValidationException(errorMessage!);
            }
        }
public static void EnsureIsValid ( this ComponentValidator validator , GeneticComponent component ) { if ( validator == null ) { throw new ArgumentNullException ( nameof ( validator ) ) ; } if ( component == null ) { throw new ArgumentNullException ( nameof ( component ) ) ; } string ? errorMessage ; if ( ! validator . IsValid ( component , out errorMessage ) ) { throw new ValidationException ( errorMessage ! ) ; } }
Checks whether the property is valid.
Checks whether the property is valid .
ComponentValidator
this
component
GeneticComponent
The  to be validated.
The to be validated .
validator
to perform the validation.
to perform the validation .