public static bool TryCreate(string phoneNumber, out PhoneNumber result, out string failureReason) { var specification = new PhoneNumberSpecification(); if (specification.IsSatisfiedBy(phoneNumber)) { result = new PhoneNumber(phoneNumber); failureReason = string.Empty; return true; } result = null; failureReason = specification.GetReasonsForDissatisfactionSeparatedWithNewLine(); return false; }
protected bool Equals(PhoneNumber other) { return phoneNumber.Equals(other.phoneNumber); }