Heres my problem. My app has several projects.
- WEB (Controllers and views)
- Services
- Data (edmx and Repositories)
- Entities (POCO)
- Tests
So in my Web project I have the ninject configuration
[assembly: WebActivator.PreApplicationStartMethod(typeof(PublicPanama.AppStart_NinjectMVC3), "Start")]
namespace Web{
public static class AppStart_NinjectMVC3 {
public static void RegisterServices(IKernel kernel) {
//kernel.Bind<IThingRepository>().To<SqlThingRepository>();
kernel.Bind<IContributorService>().To<ContributorService>();
}
public static void Start() {
// Create Ninject DI Kernel
IKernel kernel = new StandardKernel();
// Register services with our Ninject DI Container
RegisterServices(kernel);
// Tell ASP.NET MVC 3 to use our Ninject DI Container
DependencyResolver.SetResolver(new NinjectServiceLocator(kernel));
}
}
}
The problem is, I also want to add
kernel.Bind<IRepository>().To<Repository>();
But my Web project does not have a reference to the Data project.. and just adding the reference for this doesnt seem right..
what am I missing? please help!