문제

I have two custom attributes in my asp.net mvc(C#) application.

[CustAttribute1()]
[CustAttribute2()]

When I use those attributes to my actions, which will get executed first?

[CustAttribute1()]
[CustAttribute2()]
public ActionResult Index()
{

Can I use more than one custom attributes for my actions? If so, in the above Action, which custom attribute will execute first?

도움이 되었습니까?

해결책

Set the Order property.

[CustAttribute1(Order=2)]
[CustAttribute2(Order=1)]
public ActionResult Index() {
    return View();
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top