コード例 #1
0
        public static ValidateTarget <TValue?> IsNull <TValue>([ValidatedNotNull] this ValidateTarget <TValue?> target, Func <string> getErrorMessage = null)
            where TValue : struct
        {
            if (target.Value.HasValue)
            {
                ExceptionFactory.ThrowException(target.Traits.GenericFailureExceptionType, getErrorMessage != null ? getErrorMessage.Invoke() : ErrorMessageFactory.ShouldBeNull(target));
            }

            return(target);
        }