// Called by the Durable client binding infrastructure
        public DurabilityProvider GetDurabilityProvider(DurableClientAttribute attribute)
        {
            // TODO: Much of this logic should go into the base class
            if (string.IsNullOrEmpty(attribute.ConnectionName) &&
                string.IsNullOrEmpty(attribute.TaskHub))
            {
                return(this.GetDurabilityProvider());
            }

            lock (this.clientProviders)
            {
                string key = GetDurabilityProviderKey(attribute);
                if (this.clientProviders.TryGetValue(key, out DurabilityProvider clientProvider))
                {
                    return(clientProvider);
                }

                SqlDurabilityOptions        clientOptions = this.GetSqlOptions(attribute);
                IOrchestrationServiceClient serviceClient =
                    new SqlOrchestrationService(clientOptions.GetOrchestrationServiceSettings(
                                                    this.extensionOptions,
                                                    this.connectionStringResolver));
                clientProvider = new SqlDurabilityProvider(
                    this.GetOrchestrationService(),
                    clientOptions,
                    serviceClient);

                this.clientProviders.Add(key, clientProvider);
                return(clientProvider);
            }
        }
        SqlOrchestrationServiceSettings GetOrchestrationServiceSettings()
        {
            if (this.orchestrationServiceSettings == null)
            {
                SqlDurabilityOptions options = this.GetDefaultSqlOptions();
                this.orchestrationServiceSettings = options.GetOrchestrationServiceSettings(
                    this.extensionOptions,
                    this.connectionStringResolver);
            }

            return(this.orchestrationServiceSettings);
        }