Hello, I have some code like:
public int MyProperty {
set {
if (value < 0) {
throw new ArgumentOutOfRangeException("??paramName??",
"Value must be positive.")
}
_myProperty = value;
}
}
(Obviously this is just an example to illustrate the question.)
The question is what should I pass to the ArgumentOutOfRange
constructor for the "paramName" parameter? There really isn't a
parameter name with properties -- there's the "value" keyword, or do I
use the name of the property?
Thanks, Marc