Affecto.Identifiers.WebAddress.TryCreate C# (CSharp) Method

TryCreate() public static method

public static TryCreate ( string webAddress, WebAddress &result, string &failureReason ) : bool
webAddress string
result WebAddress
failureReason string
return bool
        public static bool TryCreate(string webAddress, out WebAddress result, out string failureReason)
        {
            var specification = new WebAddressSpecification();
            if (specification.IsSatisfiedBy(webAddress))
            {
                result = new WebAddress(webAddress);
                failureReason = string.Empty;
                return true;
            }

            result = null;
            failureReason = specification.GetReasonsForDissatisfactionSeparatedWithNewLine();
            return false;
        }