我在DbContext有以下实体: public class A { public A() { Bs = new List<B>(); } public ICollection<B> Bs { set; get; } } 有时我想更新图表: var a = dbContext.As .AsNoTracking() .Include(x=>x.Bs) .firstOrDefault(); var c = new C(); a.Bs.Add(c); var d = new D(); var e1 = new E(); var e2 = new E(); d.Es.Add(e1); //<– added new E […]