Table of Contents

Class Arg<T>

Namespace
Utils.Objects
Assembly
Utils.dll

Provides argument validation helpers that throw ArgumentException instances.

public class Arg<T> : CheckBase<T>

Type Parameters

T

Type of the argument to validate.

Inheritance
Arg<T>
Inherited Members
Extension Methods

Constructors

Arg(T, string)

Initializes a new instance of the Arg<T> class.

public Arg(T value, string name = "")

Parameters

value T

Argument value to validate.

name string

Name of the argument being validated.

Methods

OnNull()

Handles the null-case for the value.

protected override void OnNull()

ThrowErrors()

Throws the accumulated validation errors.

public override void ThrowErrors()

Remarks

When exactly one error has been recorded, it is rethrown directly (preserving type and stack). When multiple errors were recorded, they are wrapped in an AggregateException so all individual causes remain accessible (#64).

Exceptions

AggregateException

Thrown when more than one validation error was recorded.