我在我的mvc3项目中有一个“账户”区域。
它有一个AreaRegistration类来限制只有注册用户才能看到,代码如下:
public class AccountAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "Account";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"Account_default",
"{account}/{controller}/{action}/{id}",
new {controller = "Dashboard", action = "Index", id = UrlParameter.Optional },
new {account = new MustBeRegisteredAccount(DEPENDENCIES)},
new string[] {"Continuum.Web.Areas.Account.Controllers"}
);
}
}
那么我该如何设置Ninject以便解决依赖项/创建MustBeRegisteredAccount对象呢?