Dependency Injection for Auditor is not being called

Posts   
 
    
BrentS
User
Posts: 5
Joined: 20-Feb-2018
# Posted on: 20-Feb-2018 16:49:29   

I'm pretty confident there's something wrong on my side. I've followed the steps in

https://www.llblgen.com/Documentation/2.6/Using%20the%20generated%20code/gencode_auditing.htm

Which basically just say to create that class using IEntity2 or IEntity(tried both) and LLBLGen code should use dependency injection to find it and call it. But it's not. I'm running on v3.5 right now ( I can upgrade if necessary ). Basically I'm wondering if there was another step for the dependency injection to happen other than building that code into your project that wasn't mentioned on that documentation page.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 20-Feb-2018 20:36:57   

There is a link on the page you shared called Dependency Injection

Did you check it out?

You need to enable DI discovery, either through manual or automatic configuration.

BrentS
User
Posts: 5
Joined: 20-Feb-2018
# Posted on: 20-Feb-2018 20:40:09   

No I did not. I didn't realize that link was required. I'd suggest dropping it down with the Example you give on doing full dependency injection so someone else like me doesn't realize you need to go into there to see other steps.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 20-Feb-2018 20:46:55   

It's a long document, and DI is used elsewhere as well. So instead of repeating the entire document multiple times, it was written separately and linked when needed.

I'll close this thread for now, if you face a problem with it, please reply here and it will be re-opened.

Thanks,

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 21-Feb-2018 09:52:57   

BrentS wrote:

No I did not. I didn't realize that link was required. I'd suggest dropping it down with the Example you give on doing full dependency injection so someone else like me doesn't realize you need to go into there to see other steps.

There are several 'note' parts on the page referring to dependency injection. It's not required however, you can also create an auditor by setting the AuditorToUse property, or by overriding CreateAuditor (see: https://www.llblgen.com/Documentation/5.3/LLBLGen%20Pro%20RTF/Using%20the%20generated%20code/gencode_auditing.htm#setting-an-entitys-auditor) or by using DependencyInjection. That's why it's specified there as an option.

Frans Bouma | Lead developer LLBLGen Pro