In EF 4.1+, is there a difference between these 2 lines of code?
dbContext.SomeEntitySet.Add(entityInstance);
dbContext.Entry(entityInstance).State = EntityState.Added;
Or do they do the same thing? I'm wondering if one might affect child collections / navigation properties differently than the other.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…