Why isn't server side validation working in my ASP.Net MVC3 application with Entity Framework?
问题 I have an ASP.NET MVC3 application that uses entities generated from a database. Each entity has also has a separate partial class that uses the MetadataType attribute to associate each entity with a class that is decorated with a number of validation attributes (see below). [MetadataType(typeof(Drawing.Metadata))] public partial class Drawing { private sealed class Metadata { [Required] [StringLength(50, MinimumLength = 3, ErrorMessage = "Drawing numbers must be between {2} and {1}