Class Ensure.Argument
- Namespace
- Dynamicweb.Core
- Assembly
- Dynamicweb.Core.dll
Argument-specific ensure methods
public static class Ensure.Argument
- Inheritance
-
Ensure.Argument
- Inherited Members
Methods
Is(bool, string)
Ensures given condition is true
public static void Is(bool condition, string message = "")
Parameters
Exceptions
- ArgumentException
- Thrown if
condition
is false
IsNot(bool, string)
Ensures given condition is false
public static void IsNot(bool condition, string message = "")
Parameters
Exceptions
- ArgumentException
- Thrown if
condition
is true
NotNull(object, string)
Ensures given value is not null
public static void NotNull(object value, string parameterName = "")
Parameters
Exceptions
- ArgumentNullException
- Thrown if
value
is null
NotNullOrEmpty(string, string)
Ensures the given string value is not null or empty
public static void NotNullOrEmpty(string value, string parameterName = "")
Parameters
value
string- Value to test for null or empty
parameterName
string- Name of the parameter in the method
Exceptions
- ArgumentException
- Thrown if
value
is null or empty string