Looking solution for get query from _dbContext.SaveChangesAsync() for save logs and easier debugging
Hello, i have a .net core 6.0 app that save entites in MSSQL database with EfCORE 6.0
so my function is something like
What i want to do:
every Add/Modify query that going to DB should create new Log in my Logging table
2 Replies
DbContext.SaveChanges(async)
can be overridden. Override it, get the added/changed/deleted entities and log them
event EventHandler<SavingChangesEventArgs>? SavingChanges
also exists in dbContext.
And event EventHandler<SavedChangesEventArgs>? SavedChanges
.Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.