3
Answers

Strongly typed collection

Kopano Choane

Kopano Choane

11y
1.2k
1
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)