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

Static configuration is bad for multiple contexts #153

Closed Bemjamin closed 4 years ago

Bemjamin commented 7 years ago

Should not the GlobalTrackingConfig properties be part of the TrackerContext?

I am having some "issues" because we need to deal with multiple contexts with different behaviors. In one context in some part of my logic I have to disable the Audit for some inserts and enable it after, but by using the GlobalTrackingConfig, I am disabling the Audit for all contexts and this could be dangerous because in this moment I could receive another request to do another thing and this request would never be Audited.

What do you say? By the way, I really appreciated what you did.

bilal-fazlani commented 7 years ago

@Bemjamin I agree. That's why some guy created a pull request to manage tracking on context level. You now have a property called TrackingEnabled on the context and it doesn't affect any other context instance.

It must be there on nuget released version too. Please let me know if it isn't.

Also, let me know if it solves your "issue"

Bemjamin commented 7 years ago

Hello @bilal-fazlani, I installed the last stable version (3.6.1) but these changes are in the beta version (3.6.2-beta). For me now it is fixed, but when do you plan to release a 3.6.2 official version?

Thank you.