Class ConfigurationValidatorBase
Base class for configuration validators.
Inheritance
Namespace: Umbraco.Cms.Core.Configuration.Models.Validation
Assembly: Umbraco.Core.dll
Syntax
public abstract class ConfigurationValidatorBase
Methods
View SourceValidateCollection(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 |
|---|---|---|
| string | configPath | Configuration path from where the setting is found. |
| IEnumerable<ValidatableEntryBase> | values | The values to check. |
| string | validationDescription | Description of validation appended to message if validation fails. |
| string | message | A message to output if the value does not match. |
Returns
| Type | Description |
|---|---|
| bool | True if valid, false if not. |
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 |
|---|---|---|
| string | configPath | Configuration path from where the setting is found. |
| ValidatableEntryBase | value | The value to check. |
| string | validationDescription | Description of validation appended to message if validation fails. |
| string | message | A message to output if the value does not match. |
Returns
| Type | Description |
|---|---|
| bool | True if valid, false if not. |
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 |
|---|---|---|
| string | configPath | Configuration path from where the setting is found. |
| string | value | The value to check. |
| IEnumerable<string> | validValues | The set of valid values. |
| string | message | A message to output if the value does not match. |
Returns
| Type | Description |
|---|---|
| bool | True if valid, false if not. |