Search Results for

    Show / Hide Table of Contents
    View Source

    Class ConfigurationValidatorBase

    Base class for configuration validators.

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Core.Configuration.Models.Validation
    Assembly: Umbraco.Core.dll
    Syntax
    public abstract class ConfigurationValidatorBase

    Methods

    View Source

    ValidateCollection(String, IEnumerable<ValidatableEntryBase>, String, out String)

    Validates that a collection of objects are all valid based on their data annotations.

    Declaration
    public bool ValidateCollection(string configPath, IEnumerable<ValidatableEntryBase> values, string validationDescription, out string message)
    Parameters
    Type Name Description
    System.String configPath

    Configuration path from where the setting is found.

    IEnumerable<ValidatableEntryBase> values

    The values to check.

    System.String validationDescription

    Description of validation appended to message if validation fails.

    System.String message

    A message to output if the value does not match.

    Returns
    Type Description
    System.Boolean

    True if valid, false if not.

    View Source

    ValidateOptionalEntry(String, ValidatableEntryBase, String, out String)

    Validates a configuration entry is valid if provided.

    Declaration
    public bool ValidateOptionalEntry(string configPath, ValidatableEntryBase value, string validationDescription, out string message)
    Parameters
    Type Name Description
    System.String configPath

    Configuration path from where the setting is found.

    ValidatableEntryBase value

    The value to check.

    System.String validationDescription

    Description of validation appended to message if validation fails.

    System.String message

    A message to output if the value does not match.

    Returns
    Type Description
    System.Boolean

    True if valid, false if not.

    View Source

    ValidateStringIsOneOfValidValues(String, String, IEnumerable<String>, out String)

    Validates that a string is one of a set of valid values.

    Declaration
    public bool ValidateStringIsOneOfValidValues(string configPath, string value, IEnumerable<string> validValues, out string message)
    Parameters
    Type Name Description
    System.String configPath

    Configuration path from where the setting is found.

    System.String value

    The value to check.

    IEnumerable<System.String> validValues

    The set of valid values.

    System.String message

    A message to output if the value does not match.

    Returns
    Type Description
    System.Boolean

    True if valid, false if not.

    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • ValidateCollection(String, IEnumerable<ValidatableEntryBase>, String, out String)
      • ValidateOptionalEntry(String, ValidatableEntryBase, String, out String)
      • ValidateStringIsOneOfValidValues(String, String, IEnumerable<String>, out String)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX