Audit Trail Implementation in ASP .NET Core with Entity Framework Core (.NET 5)
Here is a handy technique to track changes that are done by your logged-in users. Ever wondered who had updated the value of a certain entity record in your ASP .NET Core Application? You would want to always keep a record of each and every modification made to your application data. This is quite vital for many businesses as well.

Topics Covered.
Scaffolding the CRUD Application.
Getting Started with Audit Trail Implementation in ASP .NET Core
BONUS – Cleaner way to Update Entities via EFCore.
4 An Alternative – NuGet package.

Read more – https://codewithmukesh.com/blog/audit-trail-implementation-in-aspnet-core/

There are much better ways to achieve this. Eventsourcing is one way. If you want to stick with sql and crud you should really look into temporal tables which track every change by default and are more efficient than the approach outlined in the link. https://docs.microsoft.com/en-us/sql/relational-databases/tables/temporal-tables?view=sql-server-ver15

I’m no expert, but my one grip with event sourcing is that it usually becomes a fundamental part of your domain right? thus the way the objects are materialized become part of your domain and event sourcing libs become dependencies in your domain.
This is awesome, I didn’t know it existed, thanks!

source