我的 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 以解决 DEPENDENCIES / 创建 MustBeRegisteredAccount 对象?