public class EmployeeController : Controller
{
//其他成員
public IEmployeeRepository Repository { get; private set; }
public EmployeeController(IEmployeeRepository repository)
{
this
}
}
為了讓ASP
public class MvcApplication : System
{
protected void Application_Start()
{
//其他成員
NinjectControllerActivator controllerActivator =
new NinjectControllerActivator()
controllerActivator
DefaultControllerFactory controllerFactory =
new DefaultControllerFactory(controllerActivator)
ControllerBuilder
}
}
再次運行我們的程序
返回目錄
編輯推薦
ASP
Microsoft
Java程序性能優化
Visual C++音頻/視頻技術開發與實戰
[
From:http://tw.wingwit.com/Article/program/net/201311/16068.html