With the code below, when I use the attribute in the controller, I see my 3 arguments and one more “Order” what is this ? How remove it ? It’s not last in my parameters position but in the middle (strange)
public class TestingFilterAttribute : ActionFilterAttribute
{
public TestingFilterAttribute()
{
}
public string FieldA { get; set; }
public int FieldB { get; set; }
public int FieldC { get; set; }
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
.....
base.OnActionExecuting(filterContext);
}
}
Update :
I’d like in this attribute, do a security check in database and redirect to another page in some conditions.
Order is inherited from ActionFilterAttribute. Some ActionFilters can do things such as returning an action early or redirecting elsewhere which prevents subsequent filters from executing, when you have multiple actionfilters you can supply an order so that they are executed in the order that you want.