We\'re throwing together a quick project (CRUD forms) and decided to skip view models and use EF entities directly in controllers and views. Since I\'m not used to this approach
Easiest thing to do is to use the DataAnnotations attributes that are in the System.ComponentModel.DataAnnotations anmespace.
MVC respects those and will populate your ModelError collection if any fail. In the case of your example, you could add a using statement for that namespace and then just flag a property with
[StringLength(25)]
and call it a day.