Search Results for

    Show / Hide Table of Contents
    View Source

    Class RequiredValidator

    A validator that validates that the value is not null or empty (if it is a string)

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Core.PropertyEditors.Validators
    Assembly: Umbraco.Core.dll
    Syntax
    public class RequiredValidator : IValueRequiredValidator, IValueValidator

    Constructors

    View Source

    RequiredValidator()

    Declaration
    public RequiredValidator()
    View Source

    RequiredValidator(ILocalizedTextService)

    Declaration
    public RequiredValidator(ILocalizedTextService textService)
    Parameters
    Type Name Description
    ILocalizedTextService textService

    Methods

    View Source

    Validate(Object, String, Object)

    Validates a value.

    Declaration
    public IEnumerable<ValidationResult> Validate(object value, string valueType, object dataTypeConfiguration)
    Parameters
    Type Name Description
    System.Object value

    The value to validate.

    System.String valueType

    The value type.

    System.Object dataTypeConfiguration

    A datatype configuration.

    Returns
    Type Description
    IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult>

    Validation results.

    Remarks

    The value can be a string, a Json structure (JObject, JArray...)... corresponding to what was posted by an editor.

    View Source

    ValidateRequired(Object, String)

    Validates a value.

    Declaration
    public virtual IEnumerable<ValidationResult> ValidateRequired(object value, string valueType)
    Parameters
    Type Name Description
    System.Object value

    The value to validate.

    System.String valueType

    The value type.

    Returns
    Type Description
    IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult>

    Validation results.

    Remarks

    This is used to validate values when the property type specifies that a value is required.

    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • RequiredValidator()
      • RequiredValidator(ILocalizedTextService)
    • Methods
      • Validate(Object, String, Object)
      • ValidateRequired(Object, String)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX