The only difference I can see between those 2 actions is the presence of some custom FormValueRequired
attribute which unfortunately you haven't shown nor explain what it does, but I guess it is some action selector. Anyway, you could retrieve this attribute:
public IEnumerable<Filter> GetFilters(ControllerContext controllerContext, ActionDescriptor actionDescriptor)
{
if (actionDescriptor.ControllerDescriptor.ControllerType == typeof(OrderController) &&
actionDescriptor.ActionName.Equals("Edit"))
{
// Get the FormValueRequiredAttribute that was used to decorate the action
var formValueRequiredAttribute = actionDescriptor
.GetCustomAttributes(typeof(FormValueRequiredAttribute), false)
.Cast<FormValueRequiredAttribute>()
.FirstOrDefault();
// if the action was decorated with this attribute we could read the
// property that was passed to the constructor (hopefully it is exposed
// as a public property)
if (formValueRequiredAttribute != null &&
formValueRequiredAttribute.SomeParameter == "captureorder")
{
// The CaptureOrder action was invoked
return new Filter[]
{
new Filter(_actionFilter, FilterScope.Action, null)
};
}
}
return new Filter[] { };
}