<PackageReference Include="Azure.Core" Version="1.48.0" />

Argument

static class Argument
Argument validation.
public static void AssertEnumDefined(Type enumType, object value, string name)

Throws if value is not defined for enumType.

public static void AssertInRange<T>(T value, T minimum, T maximum, string name) where T : IComparable<T>

Throws if value is less than the minimum or greater than the maximum.

public static void AssertNotDefault<T>(ref T value, string name) where T : struct, IEquatable<T>

Throws if value is the default value for type T.

public static void AssertNotNull<T>(T value, string name)

Throws if value is null.

public static void AssertNotNull<T>(T? value, string name) where T : struct

Throws if value has not been initialized.

public static void AssertNotNullOrEmpty<T>(IEnumerable<T> value, string name)

Throws if value is null or an empty collection.

public static void AssertNotNullOrEmpty(string value, string name)

Throws if value is null or an empty string.

public static void AssertNotNullOrWhiteSpace(string value, string name)

Throws if value is null, an empty string, or consists only of white-space characters.

public static void AssertNull<T>(T value, string name, string message = null)

Throws if value is not null.

public static T CheckNotNull<T>(T value, string name)

Throws if value has not been initialized; otherwise, returns value.

public static string CheckNotNullOrEmpty(string value, string name)

Throws if value is null or an empty string; otherwise, returns value.