I am trying to pass some named arguments to my Attribute constructor but whatever I do they just get ignored.
protected class FormulaOperator : AbstractMethodAttribute
{
public bool AutoConvertSingleParamToArray = true;
public bool UseStrictParamOrder = true;
public bool FlattenResults = false;
}
protected class ParameterListOperator : FormulaOperator
{
}
[ParameterListOperator(",", FlattenResults = true)]
protected object[] CollectParams(object[] collection)
{
return collection;
}
As you see FlattenResults a simple public bool, but the default value is always preserved even when I specifically pass a different value to constructor. I've tried to convert FlattenResults to property and removing the default value entirely.No luck! It should be true but is always false. Am I missing something?