C# Class Membrane.Commons.GuardAgainst

Provides a number of guard statements to protect methods against invalid input parameters
Datei anzeigen Open project: pollingj/Membrane-CMS

Public Methods

Method Description
ArgumentEmpty ( System.Guid param, string paramName ) : void

Guards against a method Guid parameter being empty

ArgumentNull ( object param, string paramName ) : void

Guards against a method parameter being null

ArgumentNullOrEmpty ( string param, string paramName ) : void

Guards against a method string parameter being null or empty

ArgumentOutsideRange ( int param, string paramName, int minimum, int maximum ) : void

Guards against a method integer parameter being outside a given range

Method Details

ArgumentEmpty() public static method

Guards against a method Guid parameter being empty
Thrown if the parameter is empty
public static ArgumentEmpty ( System.Guid param, string paramName ) : void
param System.Guid The guid parameter to validate
paramName string The name of the parameter to include in the exception (if thrown)
return void

ArgumentNull() public static method

Guards against a method parameter being null
Thrown if the parameter is null
public static ArgumentNull ( object param, string paramName ) : void
param object The parameter to validate
paramName string The name of the parameter to include in the exception (if thrown)
return void

ArgumentNullOrEmpty() public static method

Guards against a method string parameter being null or empty
Thrown if the parameter is null Thrown if the parameter is empty
public static ArgumentNullOrEmpty ( string param, string paramName ) : void
param string The string parameter to validate
paramName string The name of the parameter to include in the exception (if thrown)
return void

ArgumentOutsideRange() public static method

Guards against a method integer parameter being outside a given range
Thrown if the parameter is outside the given range
public static ArgumentOutsideRange ( int param, string paramName, int minimum, int maximum ) : void
param int The string parameter to validate
paramName string The name of the parameter to include in the exception (if thrown)
minimum int The minimum integer value that is valid for the given parameter
maximum int The maximum integer value that is valid for the given parameter
return void