Affecto.Identifiers.Finnish.BusinessIdentifier.TryCreate C# (CSharp) 메소드

TryCreate() 공개 정적인 메소드

public static TryCreate ( string businessId, BusinessIdentifier &result, string &failureReason ) : bool
businessId string
result BusinessIdentifier
failureReason string
리턴 bool
        public static bool TryCreate(string businessId, out BusinessIdentifier result, out string failureReason)
        {
            var specification = new BusinessIdentifierSpecification();
            if (specification.IsSatisfiedBy(businessId))
            {
                result = new BusinessIdentifier(businessId);
                failureReason = string.Empty;
                return true;
            }

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