CodeContract 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
CodeContract 用于验证输入参数
public ref class CodeContract abstract sealed
public static class CodeContract
type CodeContract = class
Public Module CodeContract
- 继承
-
CodeContract
方法
RequiresArgumentNotEmpty(Guid, String) |
要求 Guid 不为空 |
RequiresArgumentNotEmptyOrWhitespace(String, String) |
要求字符串不为空或仅包含空格 |
RequiresArgumentNotNull<T>(T, String) |
要求参数不为 null |
RequiresArgumentNotNullAndNotEmpty(String, String) |
要求字符串不为 null 且不为空 |
RequiresArgumentNotNullAndNotWhiteSpace(String, String) |
要求参数不为 null 且不带空格 |