internal static IEnumerable <IAsyncTextValidator> UnwrapAllAsync(this IAsyncTextValidator textValidator) { if (textValidator is IAsyncWrappedValidator wrappedValidators) { var wrapped = wrappedValidators.GetWrappedAsyncValidators(); foreach (var validator in UnwrapAllAsync(wrapped)) { yield return(validator); } } yield return(textValidator); }
public static IAsyncTextValidator WrapAsync(this IAsyncTextValidator textValidator, ITextValidator otherTextValidator) { return(new AsyncMultipleTextValidators(textValidator, new AsyncWrapTextValidator(otherTextValidator))); }
public AsyncMultipleTextValidators(IAsyncTextValidator asyncTextValidator, ITextValidator textValidator) { _textValidators = asyncTextValidator.WrapAsync(textValidator).UnwrapAllAsync(); }