[CustomAttribute]
public bool IsGreen()
{
return true;
}
How could one write the above using a DynamicMethod in c#?
UPDATE; per casperOne you cannot do this with a custom attribute.
But what about a non-custom attribute such as:
[Conditional("DEBUG")]
public bool IsGreen()
{
return true;
}
Note: I created a new post, because my last one missed the point which is: What im driving at is...how do i dynamically create a method that contains an attribute?
Also, i asked about using DynamicMethod, is there a better way?