private void ValidateBucketName(string input, ValidationContext <T> context) { if (!_validator.TryValidateBucketName(input, _cfg.BucketNameValidationMode, out ValidationStatus status, out string?allowed)) { context.AddFailure("Invalid bucket name: " + ValidationMessages.GetMessage(status, allowed)); } }
public static void ValidateBucketName(this IInputValidator validator, BucketNameValidationMode mode, string?bucketName) { if (validator.TryValidateBucketName(bucketName, mode, out ValidationStatus status, out string?message)) { return; } throw new ArgumentException("Invalid bucket name: " + ValidationMessages.GetMessage(status, message), nameof(bucketName)); }