Method ArgumentCondition
ArgumentCondition<T>(Expression<Func<T>>, Expression<Func<T, bool>>)
Checks if the given value meets the given condition.
Declaration
public static void ArgumentCondition<T>(Expression<Func<T>> expression, Expression<Func<T, bool>> condition)
Parameters
| Type | Name | Description |
|---|---|---|
| Expression<Func<T>> | expression | |
| Expression<Func<T, bool>> | condition |
Type Parameters
| Name | Description |
|---|---|
| T |
Examples
Only pass single parameters through to this call via expression, e.g. Guard.ArgumentCondition(() => value, v => true)
ArgumentCondition<T>(T, string, Expression<Func<T, bool>>)
Checks if the given value meets the given condition.
Declaration
public static void ArgumentCondition<T>(T value, string paramName, Expression<Func<T, bool>> condition)
Parameters
| Type | Name | Description |
|---|---|---|
| T | value | |
| string | paramName | |
| Expression<Func<T, bool>> | condition |
Type Parameters
| Name | Description |
|---|---|
| T |
Examples
Only pass single parameters through to this call via expression, e.g. Guard.ArgumentCondition(value, "value", v => true)