public EntityAddress(string name, string suffix)
        {
            Name   = name;
            Suffix = suffix;

            HasSuffix           = !string.IsNullOrWhiteSpace(Suffix);
            HasConnectionString = ConnectionStringInternal.TryParse(Suffix, out var _);
        }
        public virtual EntityAddress Map(EntityAddress value)
        {
            if (!value.HasConnectionString)
            {
                return(value);
            }

            var namespaceInfo = namespaces.SingleOrDefault(x => x.Connection == value.Suffix);

            if (namespaceInfo != null)
            {
                return(new EntityAddress($"{value.Name}@{namespaceInfo.Alias}"));
            }

            var namespaceName = new ConnectionStringInternal(value.Suffix).NamespaceName;

            logger.Warn($"Connection string for for namespace name '{namespaceName}' hasn't been configured. {Environment.NewLine}, replying may not work properly" +
                        "Use `AddNamespace` configuration API to map connection string to namespace alias.");
            return(value);
        }
        public INamespaceManagerInternal Create(string @namespace)
        {
            var connectionString = @namespace;

            if (!ConnectionStringInternal.IsConnectionString(connectionString))
            {
                connectionString = namespacesDefinition.GetConnectionString(connectionString);
            }

            NamespaceManager manager;

            if (settingsFactory != null)
            {
                var s       = settingsFactory(connectionString);
                var builder = new ServiceBusConnectionStringBuilder(connectionString);
                manager = new NamespaceManager(builder.GetAbsoluteRuntimeEndpoints(), s);
            }
            else
            {
                if (tokenProviderFactory != null)
                {
                    var s = new NamespaceManagerSettings
                    {
                        TokenProvider = tokenProviderFactory(connectionString)
                    };
                    var builder = new ServiceBusConnectionStringBuilder(connectionString);
                    manager = new NamespaceManager(builder.GetAbsoluteRuntimeEndpoints(), s);
                }
                else
                {
                    manager = NamespaceManager.CreateFromConnectionString(connectionString);
                }

                if (retryPolicy != null)
                {
                    manager.Settings.RetryPolicy = retryPolicy;
                }
            }
            return(new NamespaceManagerAdapterInternal(manager, connectionString));
        }
        public EntityAddress(string value)
        {
            if (string.IsNullOrWhiteSpace(value))
            {
                throw new ArgumentException("Entity address value can't be empty", nameof(value));
            }

            var splitByAt = value.Split(seperators);

            if (splitByAt.Length == 1)
            {
                Name   = splitByAt[0];
                Suffix = string.Empty;
            }
            else
            {
                Name   = splitByAt[0];
                Suffix = splitByAt[splitByAt.Length - 1];
            }

            HasSuffix           = !string.IsNullOrWhiteSpace(Suffix);
            HasConnectionString = ConnectionStringInternal.TryParse(Suffix, out var _);
        }