MaxLength
is used to specify the maximum length of array or string data allowed in a property.
Your ID_EVENTO
is a nullable int
(rather than array or string), that's why the attribute doesn't work. Sounds like you either want to remove the attribute or use a different one - Range
or something?