Beispiel #1
0
        public StringTenantId(StringTenantUrn urn, string aggregateRootName) : base(urn.ArName, urn)
        {
            if (urn.ArName.Equals(aggregateRootName, StringComparison.OrdinalIgnoreCase) == false)
            {
                throw new ArgumentException("AggregateRootName missmatch");
            }

            Id     = urn.Id;
            Tenant = urn.Tenant;
        }
Beispiel #2
0
        public static bool TryParse(string urn, out StringTenantUrn parsedUrn)
        {
            var match = System.Text.RegularExpressions.Regex.Match(urn, regex, System.Text.RegularExpressions.RegexOptions.None);

            if (match.Success)
            {
                parsedUrn = new StringTenantUrn(match.Groups["tenant"].Value, match.Groups["arname"].Value, match.Groups["id"].Value);
                return(true);
            }

            parsedUrn = null;

            return(false);
        }