Method ArgumentNotNull
ArgumentNotNull<T>(Expression<Func<T>>)
Checks if the given value is not null.
Declaration
public static void ArgumentNotNull<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.ArgumentNotNull(() => someParam)
ArgumentNotNull<T>(T, string)
Checks if the given value is not null.
Declaration
public static void ArgumentNotNull<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.ArgumentNotNull(someParam, nameof(someParam))