Class GenericGuards
Guards for generic types
Namespace: O9d.Guard
Assembly: O9d.Guard.dll
Syntax
public static class GenericGuards : object
Methods
| Improve this Doc View SourceNotNull<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 |
Type Parameters
Name | Description |
---|---|
T | The type |
Examples
_customer = customer.NotNull(nameof(customer));