2

任何想法是什么意思?调用看起来像:

Require.IsTrue(value == null || type.IsInstanceOfType(value),
    "value",
    "The specified value must be an instance of the specified type.");

升级版:

[ContractArgumentValidator]
public static void IsTrue(
    Boolean condition, String paramName, String message)
{
    if(!condition)
    {
        throw new ArgumentException(message, paramName);
    }
    Contract.EndContractBlock();
}
4

1 回答 1

1

不要使用 || 或 && 运算符在验证器的参数中。反编译不支持。

于 2013-04-24T21:21:43.413 回答