Skip to content

Commit 061c242

Browse files
authored
Merge pull request #121 from ridercz/patch-1
Add missing MergeAttribute method to sample.
2 parents e78489a + 572b715 commit 061c242

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.MD

+10
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,16 @@ public class ClassicMovieAttribute : ValidationAttribute, IClientModelValidator
120120
var year = _year.ToString(CultureInfo.InvariantCulture);
121121
MergeAttribute(context.Attributes, "data-val-classicmovie-year", year);
122122
}
123+
124+
private static bool MergeAttribute(IDictionary<string, string> attributes, string key, string value) {
125+
if (attributes.ContainsKey(key)) {
126+
return false;
127+
}
128+
129+
attributes.Add(key, value);
130+
return true;
131+
}
132+
123133
}
124134
```
125135

0 commit comments

Comments
 (0)