Innovt Platform
Search Results for

    Show / Hide Table of Contents

    Class Check

    Provides static methods for checking arguments and values.

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

    Methods

    | Edit this page View Source

    AreEqual(decimal, decimal, string)

    Checks if two decimal values are equal; otherwise, throws a BusinessException with the specified message.

    Declaration
    public static void AreEqual(decimal value, decimal value2, string message)
    Parameters
    Type Name Description
    decimal value

    The first decimal value to compare.

    decimal value2

    The second decimal value to compare.

    string message

    The message to include in the exception if the values are not equal.

    Exceptions
    Type Condition
    BusinessException

    Thrown if the two decimal values are not equal.

    | Edit this page View Source

    AreEqual(int, int, string)

    Checks if two long values are equal; otherwise, throws a BusinessException with the specified message.

    Declaration
    public static void AreEqual(int value, int value2, string message)
    Parameters
    Type Name Description
    int value

    The first long value to compare.

    int value2

    The second long value to compare.

    string message

    The message for the exception if the values are not equal.

    Exceptions
    Type Condition
    BusinessException

    Thrown if the values are not equal, with the specified message.

    | Edit this page View Source

    AreEqual(long, long, string)

    Checks if two decimal values are equal; otherwise, throws a BusinessException with the specified message.

    Declaration
    public static void AreEqual(long value, long value2, string message)
    Parameters
    Type Name Description
    long value

    The first decimal value to compare.

    long value2

    The second decimal value to compare.

    string message

    The message for the exception if the values are not equal.

    Exceptions
    Type Condition
    BusinessException

    Thrown if the values are not equal, with the specified message.

    | Edit this page View Source

    AreEqual(string, string, string)

    Checks if two integer values are equal; otherwise, throws a BusinessException with the specified message.

    Declaration
    public static void AreEqual(string value, string value2, string message)
    Parameters
    Type Name Description
    string value

    The first integer value to compare.

    string value2

    The second integer value to compare.

    string message

    The message for the exception if the values are not equal.

    Exceptions
    Type Condition
    BusinessException

    Thrown if the values are not equal, with the specified message.

    | Edit this page View Source

    AreNotEqual(int, int, string)

    Checks if two integer values are not equal; otherwise, throws a BusinessException with the specified message.

    Declaration
    public static void AreNotEqual(int value, int value2, string message)
    Parameters
    Type Name Description
    int value

    The first integer value to compare.

    int value2

    The second integer value to compare.

    string message

    The message for the exception if the values are equal.

    Exceptions
    Type Condition
    BusinessException

    Thrown if the values are equal, with the specified message.

    | Edit this page View Source

    AreNotEqual(long, long, string)

    Checks if two long values are not equal; otherwise, throws a BusinessException with the specified message.

    Declaration
    public static void AreNotEqual(long value, long value2, string message)
    Parameters
    Type Name Description
    long value

    The first long value to compare.

    long value2

    The second long value to compare.

    string message

    The message for the exception if the values are equal.

    Exceptions
    Type Condition
    BusinessException

    Thrown if the values are equal, with the specified message.

    | Edit this page View Source

    AreNotEqual(string, string, string)

    Checks if two strings are not equal while ignoring case sensitivity; otherwise, throws a BusinessException with the specified message.

    Declaration
    public static void AreNotEqual(string value, string value2, string message)
    Parameters
    Type Name Description
    string value

    The first string to compare.

    string value2

    The second string to compare.

    string message

    The message for the exception if the strings are equal.

    Exceptions
    Type Condition
    BusinessException

    Thrown if the strings are equal, ignoring case sensitivity, with the specified message.

    | Edit this page View Source

    NotEmpty(string, string)

    Checks if the specified string is not null and not empty; otherwise, throws an ArgumentNullException or ArgumentException.

    Declaration
    public static string NotEmpty(string value, string parameterName = null)
    Parameters
    Type Name Description
    string value

    The string to check for null and emptiness.

    string parameterName

    The name of the parameter associated with the string.

    Returns
    Type Description
    string

    The original string if it is not null and not empty.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the string is null.

    ArgumentException

    Thrown if the string is empty.

    | Edit this page View Source

    NotEmpty<T>(IReadOnlyList<T>, string)

    Checks if the specified collection is not null and not empty; otherwise, throws an ArgumentException .

    Declaration
    public static IReadOnlyList<T> NotEmpty<T>(IReadOnlyList<T> value, string parameterName)
    Parameters
    Type Name Description
    IReadOnlyList<T> value

    The collection to check for null and emptiness.

    string parameterName

    The name of the parameter associated with the collection.

    Returns
    Type Description
    IReadOnlyList<T>

    The original collection if it is not null and not empty.

    Type Parameters
    Name Description
    T

    The type of the collection elements.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the collection is null.

    ArgumentException

    Thrown if the collection is empty.

    | Edit this page View Source

    NotLessThanZero(int, string)

    Checks if the specified integer value is greater than zero; otherwise, throws a BusinessException.

    Declaration
    public static int NotLessThanZero(int value, string parameterName)
    Parameters
    Type Name Description
    int value

    The integer value to check.

    string parameterName

    The name of the parameter associated with the value.

    Returns
    Type Description
    int

    Zero if the value is greater than zero.

    Exceptions
    Type Condition
    BusinessException

    Thrown if the value is less than or equal to zero.

    | Edit this page View Source

    NotLessThanZero(int?, string)

    Checks if the specified nullable integer value is greater than zero; otherwise, throws a BusinessException.

    Declaration
    public static int NotLessThanZero(int? value, string parameterName)
    Parameters
    Type Name Description
    int? value

    The nullable integer value to check.

    string parameterName

    The name of the parameter associated with the value.

    Returns
    Type Description
    int

    Zero if the value is greater than zero.

    Exceptions
    Type Condition
    BusinessException

    Thrown if the value is less than or equal to zero.

    | Edit this page View Source

    NotLessThanZero<T>(params T[])

    Checks if the specified array of integers are greater than zero; otherwise, throws a BusinessException.

    Declaration
    public static void NotLessThanZero<T>(params T[] value)
    Parameters
    Type Name Description
    T[] value

    The array of values to check.

    Type Parameters
    Name Description
    T

    The type of the array elements, which must be convertible to an integer.

    Exceptions
    Type Condition
    BusinessException

    Thrown if any of the values is less than or equal to zero.

    | Edit this page View Source

    NotNullWithBusinessException<T>(T, string)

    Checks if the specified value is not null; otherwise, throws a BusinessException with the specified message.

    Declaration
    public static T NotNullWithBusinessException<T>(T value, string message)
    Parameters
    Type Name Description
    T value

    The value to check for null.

    string message

    The message for the exception if the value is null.

    Returns
    Type Description
    T

    The original value if it is not null.

    Type Parameters
    Name Description
    T

    The type of the value to check.

    Exceptions
    Type Condition
    BusinessException

    Thrown if the value is null, with the specified message.

    | Edit this page View Source

    NotNullWithCriticalException<T>(T, string)

    Checks if the specified value is not null; otherwise, throws a CriticalException with the specified message.

    Declaration
    public static T NotNullWithCriticalException<T>(T value, string message)
    Parameters
    Type Name Description
    T value

    The value to check for null.

    string message

    The message for the exception if the value is null.

    Returns
    Type Description
    T

    The original value if it is not null.

    Type Parameters
    Name Description
    T

    The type of the value to check.

    Exceptions
    Type Condition
    CriticalException

    Thrown if the value is null, with the specified message.

    | Edit this page View Source

    NotNull<T>(T, string)

    Checks if the specified value is not null; otherwise, throws an ArgumentNullException.

    Declaration
    public static T NotNull<T>(T value, string parameterName = null)
    Parameters
    Type Name Description
    T value

    The value to check for null.

    string parameterName

    The name of the parameter associated with the value.

    Returns
    Type Description
    T

    The original value if it is not null.

    Type Parameters
    Name Description
    T

    The type of the value to check.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the value is null.

    | Edit this page View Source

    NullButNotEmpty(string, string)

    Checks if the specified string is null but not empty; otherwise, throws an ArgumentException.

    Declaration
    public static string NullButNotEmpty(string value, string parameterName)
    Parameters
    Type Name Description
    string value

    The string to check for null but not emptiness.

    string parameterName

    The name of the parameter associated with the string.

    Returns
    Type Description
    string

    The original string if it is not null but not empty.

    Exceptions
    Type Condition
    ArgumentException

    Thrown if the string is null or empty.

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