© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
2 replies
redfoxx

Save changes twice to db

Hi. I have a question about creating a new object, saving it to database, then changing some property to fire an event, and save to db again. I can't get it to work. My code goes like this:
1. Create a new Order
2. Set Order.Status = New
3. Save changes to db
4.Set Order.Status = Placed (event fires)
5. Save changes to db

I've tried some various solutions out of desperation.. 🙂
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

EFCore - When to save changes
C#CC# / help
17mo ago
✅ Transient DbContext vs DbContextFactory
C#CC# / help
2y ago
Entity Framework Tracking not making changes to db
C#CC# / help
13mo ago
Custom HttpMessageHandler to save http request and response in DB
C#CC# / help
2y ago