public static TBase WithValidation <TBase, TParam>(this IWithConfigurableValidation <TBase, TParam> withConfigurableValidation, Func <TParam, bool> validation, Func <TParam, string?> errorMessageGenerator) { return(withConfigurableValidation.WithValidation(new SimpleValidation <TParam>(validation, errorMessageGenerator))); }
public static TBase WithValidation <TBase, TParam>(this IWithConfigurableValidation <TBase, TParam> withConfigurableValidation, Func <TParam, bool> validation, string?errorMessage = null) { return(withConfigurableValidation.WithValidation(validation, _ => errorMessage)); }