I want to create my own Attribute
in C# .Net
with an argument of Action
type, like this:
public class TestAttribute : Attribute
{
public Action MethodToExecute;
}
And the use:
[TestAttribute(MethodToExecute = () => Test())]
public string VersaoLinha { get; set; }
public static string Test()
{
return string.Empty;
}
But so, I've the error Is not a valid argument because it is not a valid attribute parameter type
. Has a way to do this?