Reputation: 4892
I have 2 hand full of update/insert/delete operations of entites and they need to run in the order I have done context.customer.Delete or context.customer.AddRange etc... At the end I do one SaveChanges().
What defines the execution order of the sql statements generated by EF and would a SaveChangesAsync() destroy a fix execution order?
Upvotes: 0
Views: 998
Reputation: 18181
I don't think you have way to control the order of sql statement as this is done by the EF framework when it calls SaveChanges. However, you can call SaveChanges after Delete to ensure it is executed, and then call AddRange again, and then SaveChanges again. Hope this helps.
Upvotes: 1