3
Reply

Strongly typed collection

Kopano Choane

Kopano Choane

Apr 23 2013 2:23 AM
1.2k
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.

Answers (3)