Entity Framework validation failed when updating a class with virtual properties
问题 I'm having problems updating a property of a class when the class contains virtual properties. Here is my code public class Policy { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public long id { get; set; } [UIHint("Company"), Required] public virtual Company company { get; set; } [UIHint("Productor"), Required] public virtual Productor productor { get; set; } [MaxLength(1000)] public string comments { get; set; } } public class Company { [Key] [DatabaseGenerated