public static ValidateTarget <bool?> NotTrue([ValidatedNotNull] this ValidateTarget <bool?> target, Func <string> getErrorMessage = null) { if (target.Value.HasValue && target.Value.Value) { ExceptionFactory.ThrowException(target.Traits.GenericFailureExceptionType, getErrorMessage != null ? getErrorMessage.Invoke() : ErrorMessageFactory.ShouldBeTrue(target)); } return(target); }