I would like to decorate a number of functions with a custom attribute. These functions will not return a specific type and can really return any type.
Now this function will call any number of other functions, and then at some point in the operation I would like to know "what is the text/value last custom attribute in the call stack".
How can I do this?
Example:
[CustomAttribute("Hello World...")]
public void SomeFunction
{
return Func1("myparam")
}
public void Func1(string xx)
{
return Func2(xx)
}
public string Func2(string yy)
{
//I would like to know what is the value\text of the attribute "CustomAttribute".
//If there are multiples in the call stack, return the last one (which might be in another class and project as Func2)
}