4
我已經成功地配置structuremap但每一頁搜索名爲「腳本」控制器Structuremap搜索腳本控制每一頁
public class StructureMapControllerFactory : DefaultControllerFactory
{
public override IController CreateController(RequestContext context, string controllerName)
{
Type controllerType = base.GetControllerType(context, controllerName);
return ObjectFactory.GetInstance(controllerType) as IController;
}
}
這是因爲參數字符串ControllerName每次來用字符串「腳本」