✅ EfCore Question: Calling .SaveChanges() between a .Remove() and .Add()

Using efcore 6....if im doing a .Remove() and then a .Add(), do I need to call .SaveChanges() in between? So .Remove() .SaveChanges() .Add() .SaveChanges() or can I skip the .SaveChanges() between add and remove, and just do .Remove() .Add() .SaveChanges() ? Thx!
3 Replies
Pobiega
Pobiega2y ago
You can do the second. Ef core has excellent entity tracking
SomeFooGuy13
SomeFooGuy13OP2y ago
got it. thank you. i saw it combined it into an update statement, rather than 2 statements, delete and insert. so i guess it's smart enough to automagically sort things out.
Pobiega
Pobiega2y ago
You can /close the thread if you don't have any further questions.
Want results from more Discord servers?
Add your server