public static ValidateTarget <TValue> IsGreaterOrEqualThan <TValue>([ValidatedNotNull] this ValidateTarget <TValue> target, object valueToCompare, Func <string> getErrorMessage = null, System.Collections.IComparer customComparer = null)
            where TValue : IComparable
        {
            System.Collections.IComparer comparer = customComparer ?? Comparer <TValue> .Default;
            if (comparer.Compare(target.Value, valueToCompare) < 0)
            {
                ExceptionFactory.ThrowException(target.Traits.OutOfRangeExceptionType, getErrorMessage != null ? getErrorMessage.Invoke() : ErrorMessageFactory.ShouldBeGreaterOrEqualThan(target, valueToCompare));
            }

            return(target);
        }
        public static ValidateTarget <TValue?> IsGreaterOrEqualThan <TValue>([ValidatedNotNull] this ValidateTarget <TValue?> target, TValue valueToCompare, Func <string> getErrorMessage = null, IComparer <TValue> customComparer = null)
            where TValue : struct, IComparable <TValue>
        {
            if (target.Value.HasValue)
            {
                IComparer <TValue> comparer = customComparer ?? Comparer <TValue> .Default;
                if (comparer.Compare(target.Value.Value, valueToCompare) < 0)
                {
                    ExceptionFactory.ThrowException(target.Traits.OutOfRangeExceptionType, getErrorMessage != null ? getErrorMessage.Invoke() : ErrorMessageFactory.ShouldBeGreaterOrEqualThan(target, valueToCompare));
                }
            }

            return(target);
        }
        public static ValidateTarget <double?> IsGreaterOrEqualThan([ValidatedNotNull] this ValidateTarget <double?> target, double valueToCompare, double allowedError, Func <string> getErrorMessage = null)
        {
            if (target.Value.HasValue)
            {
                var diff = Math.Abs(target.Value.Value - valueToCompare);
                if (diff > allowedError && target.Value < valueToCompare)
                {
                    ExceptionFactory.ThrowException(target.Traits.OutOfRangeExceptionType, getErrorMessage != null ? getErrorMessage.Invoke() : ErrorMessageFactory.ShouldBeGreaterOrEqualThan(target, valueToCompare));
                }
            }

            return(target);
        }