diff --git a/README.MD b/README.MD index 6703b99..0845cf2 100644 --- a/README.MD +++ b/README.MD @@ -122,6 +122,16 @@ public class ClassicMovieAttribute : ValidationAttribute, IClientModelValidator var year = _year.ToString(CultureInfo.InvariantCulture); MergeAttribute(context.Attributes, "data-val-classicmovie-year", year); } + + private static bool MergeAttribute(IDictionary attributes, string key, string value) { + if (attributes.ContainsKey(key)) { + return false; + } + + attributes.Add(key, value); + return true; + } + } ```