I want to add a column that stores the current DateTime when a record is saved to disk. What would be the best way to accomplish this?
I know it’s not a very complex problem, but I wondered if there is any best practice or any feature of EF that would simplify the task.
For example:
- Is there any way to include the logic for this field inside the table Class, so that it’s automatically updated whenever it’s saved to disk?
- Is there any event to capture when an object is modified or saved?
one option would be to create repository layer and implement your own SaveChanges