Good Morning
Lets I want to validate something inside a property...
private string _phoneType;
public string PhoneType
{
get
{
return _phoneType;
}
set
{
_phoneType = value;
}
}
valid values for PhoneType are: "Home", "Mobile" and "Work". If an invalid value
is supplied, an ArgumentOutOfRangeException must be thrown using the 5th
overload with 3 parameters, with meaningful messages
Please explain what that above statement mean.
Loading
VulpesPosted Apr 24, 2013, 11:06 AM
http://msdn.microsoft.com/en-US/library/system.argumentexception.argumentexception(v=vs.110).aspx
So, I think what's needed is something like this:
private string _phoneType;
Emile De wildePosted Apr 24, 2013, 10:31 AM
Vishal GilbilePosted Apr 23, 2013, 4:33 AM
Try the following Code.