In asp.net boilerplate, we have the need to track changes to entities. I see that ABP has entity tracking (new) but it's storing all changes across entities in one table, which won't work for us. Is it possible to create a custom IEntityHistoryStore
to store those changes per entity (in their own table)?
For example, let's say there's an entity Task
.
[Table("Task", Schema = "Tasks")]
public class Task : Entity<int>
{
[Column(TypeName = "varchar(255)")]
public string Description { get; set; }
// some more poco properties
}
Then what I would like to define is another table, zzLog.Tasks_Task and I would like that table to look like this:
╔════════╦════════════════════════╦══════╦══════════╦════════════════════╗
║ TaskId ║ Description ║ lgId ║ lgAction ║ lgTime ║
╠════════╬════════════════════════╬══════╬══════════╬════════════════════╣
║ 1 ║ Some description ║ 1 ║ 1 ║ 2019-05-30 9:05 AM ║
║ 1 ║ Some other description ║ 2 ║ 2 ║ 2019-05-30 9:06 AM ║
║ 1 ║ Changed again ║ 3 ║ 2 ║ 2019-05-30 9:07 AM ║
║ 1 ║ Changed again ║ 4 ║ 3 ║ 2019-05-30 9:08 AM ║
╚════════╩════════════════════════╩══════╩══════════╩════════════════════╝
lgAction
is an enum, 1 = create, 2 = update, 3 = delete
Is this possible? Instinct says no since IEntityHistoryStore
likely can't work this way.