Using Ninject with the Patterns in Action application

 
108   96.6
Jun 11, 2012
 

If I wanted to add Ninject to the Patterns in Action project.

Then remove DataAccess. Which layer would I put it in and how?
For example, I want to remove private static readonly IAuditDao _auditDao = DataAccess.AuditDao.
Would I add Ninject in the Service layer in place of private static readonly IAuditDao _auditDao = DataAccess.AuditDao?

Or do I add Ninject in Presentation layer?

Thanks
Dennis

 3 comments
 
Presentation Layer should not be the place to initialize a dataaccess object. You can private static readonly IAuditDao _auditDao = injector.Get(); before you do that, you should bind all dependencies to it. --- Barış Kaplan  Jun 14, 2012
 
I am newbie here, how to print code cause' it deletes greater than and less than sign in the content --- Barış Kaplan  Jun 14, 2012
 
So I would add ninject to the presentation layer? Add a "NinjectControllerFactory" class to my presentation and add my code? --- Dennis Tucker  Jun 28, 2012