adamfoneil / Dapper.CX

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

consider GetTrackedAsync/SaveTrackedAsync methods #12

Closed adamfoneil closed 4 years ago

adamfoneil commented 4 years ago

This would combine GetAsync and wrap it in a ChangeTracker<T>. I think you'd need something like a new GetTrackedResult type like this:

public class TrackedModel<T>
{
    public T Model { get; set; } // this is your returned model instance that you work with
    public LoggedChangeTracker<T> ChangeTracker { get; set; }
}

Then there would be an extension method SaveTrackedAsync that accepts a TrackedModel<T> in turn when saving.

adamfoneil commented 4 years ago

I don't believe this really simplifies anything -- not going to do this