Innovt Platform
Search Results for

    Show / Hide Table of Contents

    Class Extensions

    A static class containing extension methods for validating objects that implement the IValidatableObject interface.

    Inheritance
    object
    Extensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Innovt.Core.Validation
    Assembly: Innovt.Core.dll
    Syntax
    public static class Extensions

    Methods

    | Edit this page View Source

    EnsureIsValid(ICommand, ValidationContext)

    Ensures that a command object is valid by treating it as an IValidatableObject; otherwise, throws a BusinessException with validation errors.

    Declaration
    public static void EnsureIsValid(this ICommand command, ValidationContext context = null)
    Parameters
    Type Name Description
    ICommand command

    The command to validate.

    ValidationContext context

    An optional ValidationContext to specify validation context.

    | Edit this page View Source

    EnsureIsValid(ICommand, string)

    Ensures that a command object is valid by treating it as an IValidatableObject; otherwise, throws a BusinessException with validation errors.

    Declaration
    public static void EnsureIsValid(this ICommand command, string contextName)
    Parameters
    Type Name Description
    ICommand command

    The command to validate.

    string contextName

    The name of the validation context.

    | Edit this page View Source

    EnsureIsValid(IValidatableObject, ValidationContext)

    Ensures that an object implementing the IValidatableObject interface is valid; otherwise, throws a BusinessException with validation errors.

    Declaration
    public static void EnsureIsValid(this IValidatableObject obj, ValidationContext context = null)
    Parameters
    Type Name Description
    IValidatableObject obj

    The object to validate.

    ValidationContext context

    An optional ValidationContext to specify validation context.

    | Edit this page View Source

    IsValid(IValidatableObject, ValidationContext)

    Checks whether an object implementing the IValidatableObject interface is valid.

    Declaration
    public static bool IsValid(this IValidatableObject obj, ValidationContext context = null)
    Parameters
    Type Name Description
    IValidatableObject obj

    The object to validate.

    ValidationContext context

    An optional ValidationContext to specify validation context.

    Returns
    Type Description
    bool

    True if the object is valid; otherwise, false.

    | Edit this page View Source

    Validate(IEnumerable<IValidatableObject>, ValidationContext)

    Validates a collection of objects implementing the IValidatableObject interface and returns a collection of ValidationResult objects.

    Declaration
    public static IEnumerable<ValidationResult> Validate(this IEnumerable<IValidatableObject> array, ValidationContext context = null)
    Parameters
    Type Name Description
    IEnumerable<IValidatableObject> array

    The collection of objects to validate.

    ValidationContext context

    An optional ValidationContext to specify validation context.

    Returns
    Type Description
    IEnumerable<ValidationResult>

    A collection of ValidationResult objects containing validation errors.

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX