EF Core. Saving Navigation Properties in extra Table-Columns
EF Core. Saving Navigation Properties in extra Table-Columns
Hi. What could happen to my database integrity if customer of mine starts changing the labels (recycling) old used entries and changing, for example, the label of the product "Red Tomatoes" to "Green Hot Pepper". (this is just a silly example but it shows the strength of my argument, I guess)
So I was thinking if there might be a way of "saving the labels of the associated FK's" for every table so I might recreate at a later future time how things really unfolded/happened when the real time live operation was performed?
I understand DBContext implicitly manages all of this in its "Navigation Properties" but if the property is lost in its corresponding origin table then I'll get the next label wrong for the same operation that will reflect the same old ID value (primary key number).
So I'd like to gather all of these FK's incoming labels and save them for every record. May be not a good idea but a very needed one for me for auditing purposes.
Imagine if someone changes the "Catalog's product names" in the main catalog table ... it will mess up all future recreation of historic billing for example.
I have implemented some kind of auditing feature, keeping track of Old.Values and New.Values while SaveChanges() event but is hard to manage and seek data in it because it becomes too large and is also cumbersome trying to get the most exact query to find an specific transaction's record
Thanks in advance