Table of Contents

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

condition bool

Condition to test

message string

Message of the exception if condition fails

Exceptions

ArgumentException

Thrown if condition is false

IsNot(bool, string)

Ensures given condition is false

public static void IsNot(bool condition, string message = "")

Parameters

condition bool

Condition to test

message string

Message of the exception if condition is true

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

value object

Value to test for null

parameterName string

Name of the parameter in the method

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

To top