1
Vote

Create a MaximumCall Attribute

description

This would be for methods, like this:
 
[MaximumCall(1)]
public void SomeMethod() { }
 
Code would be added to ensure the method was called only once.
 
This would be interesting as this could enforce a singleton:
 
[MaximumCall(1)]
public MyClass() { }
 
If you tried to create more than one MyClass, it would fail.

comments