使用 Asp.NET MVC、entity framework 和使用 NInject 的依赖注入的 Log4Net

Log4Net with Asp.NET MVC, entity framework and dependency injection using NInject

刚开始使用 Log4Net,阅读 tutorial 并开始使用一个简单的控制台应用程序。但我想知道如何开始使用 MVC 和 entity framework 代码,首先使用 NInject 进行依赖注入。有哪位可以指点一下吗?

查看 MVC Ninject 扩展: https://github.com/ninject/ninject.web.mvc

或来自 Nuget:http://www.nuget.org/packages/Ninject.MVC5/

Once you do this, your controllers will be activated via Ninject, meaning you can expose dependencies on their constructors (or properties, or methods) to request injections.