I'm developing an ASP.NET MVC application. At the same time, I'm following the book "Dependency Injection in .NET" from Mark Seemann. My solution has one Data Access layer, a Domain layer, and the Web application project. Chapter two of the book says that I should put my controllers and viewmodels in a separate Presentation layer, which is what I'm trying to do right now.
Things are going ok. My goal is to build this app with DI in mind. My web app only references the Domain layer, the Data layer only references the Domain layer. Everything is as decoupled as I can possibly make it.
However, my web application project uses Ninject as the container, and in one class called NinjectWebCommon, I have to register one of my types as follows:
kernel.Bind<ITransactionRepository>().To<TransactionRepository>();
As you can see, I now have to reference TransactionRepository which is in my Data layer. Is it ok that my web application references the Data layer? Should it? Or is there another solution to prevent this coupling? Should I move NinjectWebCommon to the Presentation layer? I'm not sure what is best practice in this case. Unfortunately the book does not go too much into detail when it comes to this Presentation layer in an ASP.NET MVC application.