I'm just learning Ninject and how to implement it in an MVC situation. I am trying to figure out which best way / practice is to set up the following scenario.
I have a Team Object that will be reused from within the application, what I need to do is that Ninject will enable the binding automatically depending on where the request is coming from.
In my NinjectController factory, I currently have a Service that resolves a command to its correct repository.
Bind<ITeamRepository>().To<SwimTeamRepository>() // non-space characters to enable edit submission
But if the request comes from SoccerController, I need to bind:
Bind<ITeamRepository>().To<SoccerTeamRepository>()
If you do this conditionally, configure individual services? What is the best approach here? Or I'm completely not in the mountains here ...
c # asp.net-mvc ninject binding
keeg
source share