Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Framework the order sql generated by Savechanges()

I am looking at the sql executed when I call SaveChanges on context, it does update , delete and insert sql stament in that order.. is there a way to change it to delete , update , insert ?

like image 249
charvind Avatar asked Nov 26 '22 16:11

charvind


1 Answers

The only way that I can think of is to call your Delete() first then SaveChanges() then do the rest Insert() and Update(). Not saying that is the only way...

Looks like there is no way to change the order... - DbContext SaveChanges Order of Statement Execution

like image 72
bytebender Avatar answered Dec 05 '22 23:12

bytebender