Requires 类

定义

失败时引发 ArgumentExceptions 的常见运行时检查。

public ref class Requires abstract sealed
public static class Requires
type Requires = class
Public Class Requires
继承
Requires

方法

Argument(Boolean, String, ResourceManager, String)

ArgumentException如果条件的计算结果不为 true,则引发 。

Argument(Boolean, String, ResourceManager, String, Object)

失败时引发 ArgumentExceptions 的常见运行时检查。

Argument(Boolean, String, ResourceManager, String, Object, Object)

ArgumentException如果条件的计算结果不为 true,则引发 。

Argument(Boolean, String, ResourceManager, String, Object[])

ArgumentException如果条件的计算结果不为 true,则引发 。

Argument(Boolean, String, String)

ArgumentException如果条件的计算结果不为 true,则引发 。

Argument(Boolean, String, String, Object)

ArgumentException如果条件的计算结果不为 true,则引发 。

Argument(Boolean, String, String, Object, Object)

ArgumentException如果条件的计算结果不为 true,则引发 。

Argument(Boolean, String, String, Object[])

ArgumentException如果条件的计算结果不为 true,则引发 。

Argument(Boolean, String, ValidationInterpolatedStringHandler)

ArgumentException如果条件的计算结果不为 true,则引发 。

Defined<TEnum>(TEnum, String)

InvalidEnumArgumentException如果给定值不是枚举类型的命名值,则引发 。

Fail(Exception, String, Object[])

引发 ArgumentException。

Fail(String)

引发 ArgumentException。

Fail(String, Object[])

引发 ArgumentException。

FailRange(String, String)

ArgumentOutOfRangeException如果条件的计算结果不为 true,则引发 。

NotDefault<T>(T, String)

ArgumentException如果指定参数的值等于 的默认值TypeT,则引发 。

NotEmpty(Guid, String)

如果指定参数的值为 Empty,则引发异常。

NotNull(IntPtr, String)

如果指定参数的值为 IntPtr.Zero,则引发异常。

NotNull(Task, String)

如果指定参数的值为 null,则引发异常。

NotNull<T>(T, String)

如果指定参数的值为 null,则引发异常。

NotNull<T>(Task<T>, String)

如果指定参数的值为 null,则引发异常。

NotNullAllowStructs<T>(T, String)

如果指定参数的值为 null,则引发异常。

NotNullEmptyOrNullElements<T>(IEnumerable<T>, String)

如果指定参数的值为 null、没有元素或具有 null 值的元素,则引发异常。

NotNullOrEmpty(IEnumerable, String)

如果指定参数的值为 null,没有元素,则引发异常。

NotNullOrEmpty(String, String)

如果指定参数的值为 null 或为空,则引发异常。

NotNullOrEmpty<T>(ICollection<T>, String)

如果指定参数的值为 null,没有元素,则引发异常。

NotNullOrEmpty<T>(IEnumerable<T>, String)

如果指定参数的值为 null,没有元素,则引发异常。

NotNullOrWhiteSpace(String, String)

如果指定参数的值为 null、空或空格,则引发异常。

NullOrNotNullElements<T>(IEnumerable<T>, String)

如果指定参数的值不为 null ,并且 具有具有 null 值的元素,则引发异常。

Range(Boolean, String, String)

ArgumentOutOfRangeException如果条件的计算结果不为 true,则引发 。

ValidElements<T>(IEnumerable<T>, Predicate<T>, String, String)

如果 values 为 null、 predicate 为 null 或 values 不为 null 具有与给定谓词不匹配的元素,则引发异常。

ValidElements<T>(IEnumerable<T>, Predicate<T>, String, String, Object[])

如果 values 为 null、 predicate 为 null 或 values 不为 null 具有与给定谓词不匹配的元素,则引发异常。

适用于