Entity Framework Required Foreign Key = validation error on db.SaveChanges
问题 I have these classes for my Company Entity public class Company { public Company() { this.Users = new HashSet<User>(); this.Tools = new HashSet<Tool>(); } public int Id { get; set; } public string Name { get; set; } public string Address { get; set; } public virtual ICollection<User> Users { get; set; } public virtual ICollection<Tool> Tools { get; set; } [Required] public virtual CompanyGroup CompanyGroup { get; set; } } public class CompanyDto { public string Name { get; set; } public