C# How to use DataAnnotations StringLength and SubString to remove text
问题 I have a model classes that has a description property with a data annotation attribute of StringLength and length is set to 100 characters. When this property is more than 100 characters and Entity Framework tries to save this property I get the following error. [StringLength(100, ErrorMessage = "Description Max Length is 100")] public string Description { get; set; } Error: "Validation failed for one or more entities. See 'EntityValidationErrors' property for more details" I'm not sure if