adamfoneil / Dapper.CX

A Crud library based on Dapper
MIT License
8 stars 1 forks source link

ability to save ChangeTracker<T> in table for audit tracking #11

Closed adamfoneil closed 4 years ago

adamfoneil commented 4 years ago

I've had change tracking in earlier Postulate versions, but it was never documented, and wasn't fully implemented. I think this would be a good feature for Dapper.CX, but I'm concerned about adding ModelSync dependency. I'm not sure how I want the inline table creation to work.

I think there should be a ChangeTracker.SaveAsync(IDbConnection cn) method that's called by all the Crud methods where a ChangeTracker is passed as an argument. But should probably require explicit opt-in like ChangeTracker.SaveInTable bool.

Note also this will need a way to dereference foreign keys like older versions of this did, which involves some fancy reflection and/or new attributes perhaps.

adamfoneil commented 4 years ago

this is done with https://www.nuget.org/packages/Dapper.CX.ChangeTracking/