Turn off auditing for special occasions

Posts   
 
    
G.I.
User
Posts: 172
Joined: 09-Jun-2005
# Posted on: 07-Nov-2007 11:33:44   

Hi,

I want to use auditing to keep track on changes on entities. A mail will be send containing changes that have been done for some of these.

I have two questions:

1: I can't find it in the documentation, but how can you specify in which entity you want to inject the auditor? I mean, my auditor is generic and I want to use it only for about 10 of my 15 entities ... so I can't put a DependencyInjectionInfo attribute in my auditor class for 10 types, or can I?

2: Another problem is that there are for example news entities, and the customer doesn't want to send a entry in an email if the only change was to correct some type errors. So to be able to make a difference a checkbox is placed on the website. If this is checked, then we want to auditor to store the changes in the audit table. Is it possible to make a check for that in the auditor or is it possible to turn off auditing from the entity somehow?

Best regards,

  • G.I.
Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 07-Nov-2007 11:50:26   

I can't put a DependencyInjectionInfo attribute in my auditor class for 10 types, or can I?

You can.

Is it possible to make a check for that in the auditor or is it possible to turn off auditing from the entity somehow?

I think you should be using Dependency Injection Scopes. Please look it up in the manual under "Using the generated code -> Setting up and using Dependency Injection"

G.I.
User
Posts: 172
Joined: 09-Jun-2005
# Posted on: 09-Nov-2007 09:16:12   

Hi Walaa,

thank you very much for your answer. I found out that it is quite easily to use once you get it ... as most of LLBLGen Pro wink

These scopes work fine, but I also found out that in case since I want to log always, except on one special occasion, checkbox not checked, that it is easier to just set the ValidatorToUse of the entity to be updated to null in that special occasion.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 09-Nov-2007 10:57:40   

I guess you mean AuditorToUse wink

Alright then simple_smile

G.I.
User
Posts: 172
Joined: 09-Jun-2005
# Posted on: 09-Nov-2007 13:40:47   

Yes, that's what I meant wink