Method ArgumentNull
ArgumentNull<T>(Expression<Func<T>>)
Checks if the given value is not null.
Declaration
public static void ArgumentNull<T>(Expression<Func<T>> expression)
Parameters
Type | Name | Description |
---|---|---|
Expression<Func<T>> | expression | An expression containing a single string parameter e.g. () => someParam |
Type Parameters
Name | Description |
---|---|
T |
Examples
Only pass single parameters through to this call via expression, e.g. Guard.ArgumentNull(() => someParam)
ArgumentNull<T>(T, string)
Checks if the given value is not null.
Declaration
public static void ArgumentNull<T>(T value, string paramName)
Parameters
Type | Name | Description |
---|---|---|
T | value | |
string | paramName |
Type Parameters
Name | Description |
---|---|
T |
Examples
Pass the parameter and it's name, e.g. Guard.ArgumentNull(someParam, nameof(someParam))