示例#1
0
        public void Rename(PersonalName newName)
        {
            if (newName == null)
            {
                throw new ArgumentNullException("newName");
            }

            if (PersonalName == newName)
            {
                throw new ArgumentException("The new name must not be equal to the current name", "newName");
            }

            PersonalName = newName;
        }
示例#2
0
        public Person(PersonalName personalName, Address address)
        {
            if (personalName == null)
            {
                throw new ArgumentNullException("personalName");
            }

            if (address == null)
            {
                throw new ArgumentException("address");
            }

            PersonalName = personalName;
            Address      = address;
        }