Class SdkGuard
Sdk Guard.
Inheritance
Namespace: StylelabsStylelabs.MSdkUtilities
Assembly: Stylelabs.M.Sdk.dll
Syntax
Methods
GreaterThan(string, long, long)
Checks if the specified long is greater than a given minimum. Otherwise if the specified long is lower or equal to given minimum, fail.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| string | argument |
The name of the argument. |
| long | value |
The value of the argument. |
| long | minimum |
The minimum. |
NotNegative(string, long)
Checks if the specified long is negative.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| string | argument |
The name of the argument. |
| long | value |
The value of the argument. |
NotNull(string, object)
Checks if the specified value is null.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| string | argument |
The name of the argument. |
| object | value |
The value of the argument. |
NotNullEach<T>(string, T)
Checks if the specified collection is null or contains null values.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| string | argument |
The name of the argument. |
| T | value |
The value of the argument. |
Type Parameters
| Name | Description |
|---|---|
| T |
Type of the collection. |
NotNullMaxItems<T>(string, IEnumerable<T>, int)
Checks that the specified items does not contain more than maxItems.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| string | parameterName |
Name of the parameter. |
| IEnumerable<> | items |
Collection to check. |
| int | maxItems |
The maximum number of allowed items within the |
Type Parameters
| Name | Description |
|---|---|
| T |
The type parameter. |
NotNullMaxOneId(string, IEnumerable<long>)
The ids cannot be null.
It can be empty, but it cannot contain more than 1 value.
The value must be a strictly positive id, if it exists.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| string | parameterName |
Name of the parameter. |
| IEnumerable<>long | ids |
Collection to check. |
NotNullOrEmptyCollection<T>(string, T)
Checks if the specified collection is null or empty.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| string | argument |
The name of the argument. |
| T | value |
The value of the argument. |
Type Parameters
| Name | Description |
|---|---|
| T |
Type of the collection. |
NotNullOrInvariantCulture(string, CultureInfo)
Checks if the specified culture is null or invariant culture.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| string | argument |
The name of the argument. |
| CultureInfo | culture |
The culture. |
NotNullOrInvariantCultureEach(string, IEnumerable<CultureInfo>)
Checks if the specified culture is null or invariant culture.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| string | argument |
The name of the argument. |
| IEnumerable<>CultureInfo | cultures |
The cultures. |
NotNullOrWhiteSpace(string, string)
Checks if the specified value
is null, an empty string or white space string.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| string | argument |
The name of the argument. |
| string | value |
The value of the argument. |
NotNullOrWhiteSpaceEach(string, IEnumerable<string>)
Checks if the specified collection is null or contains null or white space strings.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| string | argument |
The name of the argument. |
| IEnumerable<>string | value |
The value of the argument. |
StrictlyPositive(string, int)
Checks if the specified number is strictly positive, i.e. greater than zero.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| string | argument |
The name of the argument. |
| int | value |
The value of the argument. |
StrictlyPositive(string, TimeSpan)
Checks if the specified time span is strictly positive, i.e. greater than zero.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| string | argument |
The name of the argument. |
| TimeSpan | value |
The value of the argument. |
ValidId(string, long?)
If the id is not null, it must be strictly positive.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| string | parameterName |
Name of the parameter. |
| long | id |
Id to check. |
ValidIds(string, IEnumerable<long>)
The ids cannot be null, and every id must be strictly positive.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| string | parameterName |
Name of the parameter. |
| IEnumerable<>long | ids |
Ids to check. |