/// <summary> /// Verify that <paramref name="parameterValue"/> is not the default value for this type. /// </summary> public static void RequireNotDefaultValue <TParameter>(TParameter parameterValue, string parameterName, string customMessage = null) { GenericContract <FulcrumServiceContractException> .RequireNotDefaultValue(parameterValue, parameterName, customMessage); }
/// <summary> /// Verify that <paramref name="parameterValue"/> is not null, not empty and contains other characters than white space. /// </summary> public static void RequireNotNullOrWhitespace(string parameterValue, string parameterName, string customMessage = null) { GenericContract <FulcrumServiceContractException> .RequireNotNullOrWhitespace(parameterValue, parameterName, customMessage); }
/// <summary> /// Verify that <paramref name="expression"/> return true, when applied to <paramref name="parameterValue"/>. /// </summary> public static void Require <TParameter>(TParameter parameterValue, Expression <Func <TParameter, bool> > expression, string parameterName) { GenericContract <FulcrumServiceContractException> .Require(parameterValue, expression, parameterName); }
/// <summary> /// Always fail, with the given <paramref name="message"/>. /// </summary> public static void Fail(string message) { RequireNotNull(message, nameof(message)); GenericContract <FulcrumServiceContractException> .Fail(message); }
/// <summary> /// Verify that <paramref name="mustBeTrue"/> really is true. /// </summary> public static void Require(bool mustBeTrue, string customMessage = null) { GenericContract <FulcrumContractException> .Require(mustBeTrue, customMessage); }
/// <summary> /// Verify that <paramref name="expression"/> returns a true value. /// </summary> public static void Require(Expression <Func <bool> > expression, string customMessage = null) { GenericContract <FulcrumContractException> .Require(expression, customMessage); }
/// <summary> /// Verify that <paramref name="parameterValue"/> is not null. /// </summary> public static void RequireNotNull <TParameter>(TParameter parameterValue, string parameterName, string customMessage = null) { GenericContract <FulcrumContractException> .RequireNotNull(parameterValue, parameterName, customMessage); }