Mahdi Taghizadeh
Mahdi Taghizadeh

Reputation: 903

Ninject 2 configuration sample for class library projects

I'm gonna use Ninject 2.0 in a project and looking for a good sample on how to configure it for a class library case. Many samples are available for WebForms and ASP.NET MVC but in my case I want to inject a Repository in my DataAccess project to Services project (both are class libraries) and I don't need to inject anything into my Web project.

Any idea?

Upvotes: 1

Views: 1006

Answers (1)

CodeClimber
CodeClimber

Reputation: 4191

You have to create a class to manage the configuration of you IoC container and use it to create you objects.

Config.GetDataAccess() and inside the Config object you encapsulate all the IoC configuration and object instantiation code

Upvotes: 1

Related Questions