Tom
September 23, 2022, 8:50am
1
Hi Mythz!
I not using auto query but I would like to use the audit log feature. My models contains who and when created, modified and deleted the record.
public DateTime CreatedDateTime { get; set; }
public int CreatedById { get; set; }
public DateTime? ModifiedDateTime { get; set; }
public int? ModifiedById { get; set; }
public DateTime? DeletedDateTime { get; set; }
public int? DeletedById { get; set; }
How can I insert record on the CrudEvent table when the model changed?
I am looking for a general solution to this problem.
Thx!
mythz
September 23, 2022, 9:51am
2
The Executable Audit Log only supports AutoQuery Crud requests.
Though you’ll still be able to inherit its AuditBase class where you’ll be able to use the WithAudit
extension method to populate it, e.g:
Db.Insert(new Record { ... }.WithAudit(Request));
Tom
September 23, 2022, 10:21am
3
The WithAudit
extension only fill the CreatedBy, CreatedDate, ModifiedBy , ModifiedDate
properties. I would like to fill and query the CrudEvent
table for the Audit log.
mythz
September 23, 2022, 10:40am
4
You can use the existing CrudEvent
table but you’d need to populate it yourself, the auto populating feature is tied to AutoQuery CRUD.
Tom
September 23, 2022, 11:57am
5
Ok, thanks for your help.