public static bool TryValidateNull(object value, [NotNull] string message, bool throwException = false) { if ((value is null) && throwException) { ExceptionThrower.ThrowInvalidValueException(message, value); } return(value is null); }
public static bool TryValidateNull(object value, bool throwException = false) { if ((value is null) && throwException) { ExceptionThrower.ThrowInvalidValueException(Resources.ObjectValidationFailed, value); } return(value is null); }
public static bool TryValidateValue(string input, bool throwException = false) { var result = string.IsNullOrEmpty(input); if (result is true && throwException) { ExceptionThrower.ThrowInvalidValueException(Resources.StringIsNotValid, input); } return(result); }
public static bool TryValidateValue <TValue>( TValue input, bool condition, string message = "", bool throwException = false) { if (condition is false && throwException) { message = CreateExceptionMessage(message, Resources.InvalidValue); ExceptionThrower.ThrowInvalidValueException <object>(message, input); } return(condition); }