Search Results for

    Show / Hide Table of Contents

    Class GenericGuards

    Guards for generic types

    Inheritance
    Object
    GenericGuards
    Namespace: O9d.Guard
    Assembly: O9d.Guard.dll
    Syntax
    public static class GenericGuards : object

    Methods

    | Improve this Doc View Source

    NotNull<T>(T, Nullable<String>)

    Validates that the provided value is not null

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

    The value to validate

    Nullable<String> name

    The name of the argument

    Returns
    Type Description
    T

    The value of value if it is not null

    Type Parameters
    Name Description
    T

    The type

    Examples
    _customer = customer.NotNull(nameof(customer));
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX