/// <summary> /// 获取需要防御流量攻击的【RouteName】 /// </summary> public static AppStartup InitMvcLimitAttack(this AppStartup startup, Assembly assembly) { var limitAttackModelList = DefendAttackService.GetLimitAttackModel(assembly); DefendAttackContainer.InitDefendAttackList(limitAttackModelList, assembly.GetName().Name); return(startup); }
/// <summary> /// 获取需要防御流量攻击的【Action】 /// </summary> public static AppStartup InitLimitAttack(this AppStartup startup, WebType webType, Assembly assembly) { var limitAttackModelList = new List <DefendAttackModel>(); if (webType == WebType.Mvc) { limitAttackModelList = DefendAttack_Mvc.GetLimitAttackModel(assembly); } else if (webType == WebType.WebApi) { limitAttackModelList = DefendAttack_WebApi.GetLimitAttackModel(assembly); } DefendAttackContainer.InitDefendAttackList(limitAttackModelList, assembly.GetName().Name); return(startup); }