I just started working with Ninject 2.0 using ASP.NET MVC 2. So, I have the IMongoRepository interface and the MongoRepository class.
MongoRepository gets a collection of parameter strings.
Depending on the collection I want to use, I pass a different value in the parameter for MongoRepository. I hope that I formulate this correctly, but how could I display various parameters depending on the controller I use?
For example, in an article controller, I would call:
_articlesRepository = new MongoRepository("Articles");
and in PageController I would call:
_pagesController = new MongoRepository("Pages");
What I would like to do is just make an injection to the constructor and just go through the IMongoRepository. Any ideas or suggestions?
By the way, I'm just learning about IOC / DI; therefore, I am open to any advice from the IOC ninja! Thank!