Skip to content

Commit 572b715

Browse files
authored
Add missing MergeAttribute method to sample.
The sample contains call to undefined method MergeAttribute and does not work. I added the method.
1 parent 343408d commit 572b715

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.MD

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,16 @@ public class ClassicMovieAttribute : ValidationAttribute, IClientModelValidator
122122
var year = _year.ToString(CultureInfo.InvariantCulture);
123123
MergeAttribute(context.Attributes, "data-val-classicmovie-year", year);
124124
}
125+
126+
private static bool MergeAttribute(IDictionary<string, string> attributes, string key, string value) {
127+
if (attributes.ContainsKey(key)) {
128+
return false;
129+
}
130+
131+
attributes.Add(key, value);
132+
return true;
133+
}
134+
125135
}
126136
```
127137

0 commit comments

Comments
 (0)