bilal-fazlani / tracker-enabled-dbcontext

Tracker-enabled DbContext offers you to implement full auditing in your database
https://tracker-enabled-dbcontext.bilal-fazlani.com/
Other
217 stars 110 forks source link

Multiple SELECT queries with GlobalTrackingConfig.DisconnectedContext = true #162

Closed ahahcbigeim closed 4 years ago

ahahcbigeim commented 5 years ago

https://github.com/bilal-fazlani/tracker-enabled-dbcontext/blob/b3fd3d922f4612e9abb90b78ed71847cfff4ffa9/TrackerEnabledDbContext.Common/Auditors/ChangeLogDetailsAuditor.cs#L88

It'll be nice to call GetDatabaseValues() only once, and cache the result. That way comparing N properties of a changed entry wouldn't result in N SELECT queries.

bilal-fazlani commented 5 years ago

@ahahcbigeim , If you think it's feasible, could you please submit a PR?

ahahcbigeim commented 5 years ago

hey @bilal-fazlani, I've submitted a PR with the described enhancement. right now I'm testing my project with the updated version. no more duplicate 'select' queries so far.

bilal-fazlani commented 5 years ago

Thanks. You now have collaborator rights on this repo so you will be able to merge pull requests. Just make sure you write test and those tests pass.