Validation Framework
Search Results for

    Show / Hide Table of Contents

    Class ValidationBuilder<T>

    Provides an advanced builder for validating complex objects with multiple properties.

    Inheritance
    object
    ValidationBuilder<T>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: ValidationFramework
    Assembly: ValidationFramework.dll
    Syntax
    public class ValidationBuilder<T> where T : class
    Type Parameters
    Name Description
    T

    The type of object to validate.

    Methods

    | Edit this page View Source

    AddValidation(string, Func<T, ValidationResult>)

    Adds a validation function for a specific property.

    Declaration
    public ValidationBuilder<T> AddValidation(string propertyName, Func<T, ValidationResult> validation)
    Parameters
    Type Name Description
    string propertyName

    The name of the property to validate.

    Func<T, ValidationResult> validation

    The validation function to apply to the property.

    Returns
    Type Description
    ValidationBuilder<T>

    This builder instance for method chaining.

    | Edit this page View Source

    Validate(T)

    Validates the specified entity against all registered property validations.

    Declaration
    public ValidationResult Validate(T entity)
    Parameters
    Type Name Description
    T entity

    The entity to validate.

    Returns
    Type Description
    ValidationResult

    A ValidationResult containing all validation errors.

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