Kopano Choane

Kopano Choane

  • 1.9k
  • 8
  • 2.6k

Strongly typed collection

Apr 23 2013 2:23 AM
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)