【文件属性】:
文件名称:Ninject.Web.Mvc:ninject的扩展,提供与ASP.NET MVC的集成
文件大小:375KB
文件格式:ZIP
更新时间:2021-04-14 18:27:39
C#
Ninject.Web.Mvc
此扩展允许和项目之间的集成。 要使用它,只需使您的HttpApplication(通常在Global.asax.cs中)扩展NinjectHttpApplication:
public class YourWebApplication : NinjectHttpApplication
{
public override void OnApplicationStarted ()
{
// This is only needed in MVC1
RegisterAllControllersIn ( " Some.Assembly.Name " );
}
public override IKernel CreateKernel ()
{
return new StandardKernel ( new SomeModu