© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
4 replies
SomeFooGuy13

✅ 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!
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Dbcontext and SaveChanges()
C#CC# / help
5mo ago
Error: Add all the req. services by calling 'AddAuthorization'. But AddAuthorizationCore was called
C#CC# / help
2y ago
[EFCore] add many Parent entities with Child entities, How to connect them in single SaveChanges
C#CC# / help
4y ago
EF Core Sqlite Add & SaveChanges not working
C#CC# / help
2y ago