1
私はBaseControllerを持っています.BaseControllerには個々のアクションではなく、すべてのコントローラーがそれを実行するという属性があります。コントローラ上に属性コードを実行したくないというアクションが1つあります。これをどのように実装できますか?Controller ActionAttributeをオーバーライドできますか?
[MyAttribute]
public class BaseController : Controller
{
}
public class WebPageController : BaseController
{
//How to override attribute executing here?
public ActionResult Index()
{
//do stuff
}
}
public class PagePermissionAttribute : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
//Do stuff
}
}
私は完全にあなたの質問を誤解。私は実際の問題に対処するソリューションを更新しました。しかし、はるかに複雑です。 – tvanfosson