I\'m having trouble with EF reordering my inserts when I try and add an entity with multiple children all at once. I\'ve got a 3 level structure with one-to-many relationsh
I've found a way to do it. It just thought I'd let you know:
using (var dbContextTransaction = dbContext.Database.BeginTransaction()) { dbContext.SomeTables1.Add(object1); dbContext.SaveChanges(); dbContext.SomeTables1.Add(object2); dbContext.SaveChanges(); dbContextTransaction.Commit(); }