public void SetAmbientConfiguration(DataConnectionConfigurationBase globalProperties, DataConnectionConfigurationBase shardSetProperties, DataConnectionConfigurationBase readWriteProperties, DataConnectionConfigurationBase shardProperties) { _globalProperties = globalProperties as SqlConnectionPropertiesBase; _shardSetProperties = shardSetProperties as SqlConnectionPropertiesBase; _readWriteProperties = readWriteProperties as SqlConnectionPropertiesBase; _shardProperties = shardProperties as SqlConnectionPropertiesBase; if (!(_globalProperties is null)) { _globalProperties.PropertyChanged += HandlePropertyChanged; } if (!(_shardSetProperties is null)) { _shardSetProperties.PropertyChanged += HandlePropertyChanged; } if (!(_readWriteProperties is null)) { _readWriteProperties.PropertyChanged += HandlePropertyChanged; } if (!(_shardProperties is null)) { _shardProperties.PropertyChanged += HandlePropertyChanged; } }
private void SetProperties(SqlConnectionStringBuilder csb, DataConnectionConfigurationBase properties) { if (!(properties.Password is null)) { csb.Password = properties.Password; } if (!(properties.UserName is null)) { csb.UserID = properties.UserName; } if (!(properties.WindowsAuth is null)) { csb.IntegratedSecurity = properties.WindowsAuth.Value; } var props = (SqlConnectionPropertiesBase)properties; if (!(props.ApplicationIntent is null)) { csb.ApplicationIntent = props.ApplicationIntent.Value; } if (!(props.ApplicationName is null)) { csb.ApplicationName = props.ApplicationName; } //if (!(props.ConnectRetryCount is null)) //{ // csb.ConnectRetryCount = props.ConnectRetryCount.Value; //} //if (!(props.ConnectRetryInterval is null)) //{ // csb.ConnectRetryInterval = props.ConnectRetryInterval.Value; //} if (!(props.ConnectTimeout is null)) { csb.ConnectTimeout = props.ConnectTimeout.Value; } if (!(props.CurrentLanguage is null)) { csb.CurrentLanguage = props.CurrentLanguage; } if (!(props.DataSource is null)) { csb.DataSource = props.DataSource; } if (!(props.Encrypt is null)) { csb.Encrypt = props.Encrypt.Value; } if (!(props.FailoverPartner is null)) { csb.FailoverPartner = props.FailoverPartner; } if (!(props.InitialCatalog is null)) { csb.InitialCatalog = props.InitialCatalog; } if (!(props.LoadBalanceTimeout is null)) { csb.LoadBalanceTimeout = props.LoadBalanceTimeout.Value; } if (!(props.MaxPoolSize is null)) { csb.MaxPoolSize = props.MaxPoolSize.Value; } if (!(props.MinPoolSize is null)) { csb.MinPoolSize = props.MinPoolSize.Value; } if (!(props.MultipleActiveResultSets is null)) { csb.MultipleActiveResultSets = props.MultipleActiveResultSets.Value; } if (!(props.MultiSubnetFailover is null)) { csb.MultiSubnetFailover = props.MultiSubnetFailover.Value; } if (!(props.PacketSize is null)) { csb.PacketSize = props.PacketSize.Value; } if (!(props.PersistSecurityInfo is null)) { csb.PersistSecurityInfo = props.PersistSecurityInfo.Value; } if (!(props.Pooling is null)) { csb.Pooling = props.Pooling.Value; } if (!(props.Replication is null)) { csb.Replication = props.Replication.Value; } if (!(props.TrustServerCertificate is null)) { csb.TrustServerCertificate = props.TrustServerCertificate.Value; } if (!(props.TypeSystemVersion is null)) { csb.TypeSystemVersion = props.TypeSystemVersion; } if (!(props.UserInstance is null)) { csb.UserInstance = props.UserInstance.Value; } if (!(props.WorkstationID is null)) { csb.WorkstationID = props.WorkstationID; } }
private void SetProperties(NpgsqlConnectionStringBuilder csb, DataConnectionConfigurationBase properties) { if (!(properties.Password is null)) { csb.Password = properties.Password; } if (!(properties.UserName is null)) { csb.Username = properties.UserName; } if (!(properties.WindowsAuth is null)) { csb.IntegratedSecurity = properties.WindowsAuth.Value; } var props = (PgConnectionPropertiesBase)properties; if (!(props.ApplicationName is null)) { csb.ApplicationName = props.ApplicationName; } if (!(props.AutoPrepareMinUsages is null)) { csb.AutoPrepareMinUsages = props.AutoPrepareMinUsages.Value; } if (!(props.CancellationTimeout is null)) { csb.CancellationTimeout = props.CancellationTimeout.Value; } if (!(props.CheckCertificateRevocation is null)) { csb.CheckCertificateRevocation = props.CheckCertificateRevocation.Value; } if (!(props.ClientCertificate is null)) { csb.ClientCertificate = props.ClientCertificate; } if (!(props.ClientCertificateKey is null)) { csb.ClientCertificateKey = props.ClientCertificateKey; } if (!(props.ClientEncoding is null)) { csb.ClientEncoding = props.ClientEncoding; } if (!(props.CommandTimeout is null)) { csb.CommandTimeout = props.CommandTimeout.Value; } if (!(props.ConnectionIdleLifetime is null)) { csb.ConnectionIdleLifetime = props.ConnectionIdleLifetime.Value; } if (!(props.ConnectionLifetime is null)) { csb.ConnectionLifetime = props.ConnectionLifetime.Value; } if (!(props.ConnectionPruningInterval is null)) { csb.ConnectionPruningInterval = props.ConnectionPruningInterval.Value; } if (!(props.ConvertInfinityDateTime is null)) { csb.ConvertInfinityDateTime = props.ConvertInfinityDateTime.Value; } if (!(props.Database is null)) { csb.Database = props.Database; } if (!(props.Encoding is null)) { csb.Encoding = props.Encoding; } if (!(props.Enlist is null)) { csb.Enlist = props.Enlist.Value; } if (!(props.Host is null)) { csb.Host = props.Host; } if (!(props.IncludeErrorDetails is null)) { csb.IncludeErrorDetails = props.IncludeErrorDetails.Value; } if (!(props.IncludeRealm is null)) { csb.IncludeRealm = props.IncludeRealm.Value; } if (!(props.InternalCommandTimeout is null)) { csb.InternalCommandTimeout = props.InternalCommandTimeout.Value; } if (!(props.KeepAlive is null)) { csb.KeepAlive = props.KeepAlive.Value; } if (!(props.KerberosServiceName is null)) { csb.KerberosServiceName = props.KerberosServiceName; } if (!(props.LoadTableComposites is null)) { csb.LoadTableComposites = props.LoadTableComposites.Value; } if (!(props.LogParameters is null)) { csb.LogParameters = props.LogParameters.Value; } if (!(props.MaxAutoPrepare is null)) { csb.MaxAutoPrepare = props.MaxAutoPrepare.Value; } if (!(props.MaxPoolSize is null)) { csb.MaxPoolSize = props.MaxPoolSize.Value; } if (!(props.MinPoolSize is null)) { csb.MinPoolSize = props.MinPoolSize.Value; } if (!(props.Multiplexing is null)) { csb.Multiplexing = props.Multiplexing.Value; } if (!(props.NoResetOnClose is null)) { csb.NoResetOnClose = props.NoResetOnClose.Value; } if (!(props.Options is null)) { csb.Options = props.Options; } if (!(props.Passfile is null)) { csb.Passfile = props.Passfile; } if (!(props.PersistSecurityInfo is null)) { csb.PersistSecurityInfo = props.PersistSecurityInfo.Value; } if (!(props.Pooling is null)) { csb.Pooling = props.Pooling.Value; } if (!(props.Port is null)) { csb.Port = props.Port.Value; } if (!(props.ReadBufferSize is null)) { csb.ReadBufferSize = props.ReadBufferSize.Value; } if (!(props.RootCertificate is null)) { csb.RootCertificate = props.RootCertificate; } if (!(props.SearchPath is null)) { csb.SearchPath = props.SearchPath; } if (!(props.ServerCompatibilityMode is null)) { csb.ServerCompatibilityMode = props.ServerCompatibilityMode.Value; } if (!(props.SocketReceiveBufferSize is null)) { csb.SocketReceiveBufferSize = props.SocketReceiveBufferSize.Value; } if (!(props.SocketSendBufferSize is null)) { csb.SocketSendBufferSize = props.SocketSendBufferSize.Value; } if (!(props.SslMode is null)) { csb.SslMode = props.SslMode.Value; } if (!(props.TcpKeepAlive is null)) { csb.TcpKeepAlive = props.TcpKeepAlive.Value; } if (!(props.TcpKeepAliveInterval is null)) { csb.TcpKeepAliveInterval = props.TcpKeepAliveInterval.Value; } if (!(props.TcpKeepAliveTime is null)) { csb.TcpKeepAliveTime = props.TcpKeepAliveTime.Value; } if (!(props.Timeout is null)) { csb.Timeout = props.Timeout.Value; } if (!(props.Timezone is null)) { csb.Timezone = props.Timezone; } if (!(props.TrustServerCertificate is null)) { csb.TrustServerCertificate = props.TrustServerCertificate.Value; } //if (!(props.UsePerfCounters is null)) //{ // csb.UsePerfCounters = props.UsePerfCounters.Value; //} //if (!(props.UseSslStream is null)) //{ // csb.UseSslStream = props.UseSslStream.Value; //} if (!(props.WriteBufferSize is null)) { csb.WriteBufferSize = props.WriteBufferSize.Value; } if (!(props.WriteCoalescingBufferThresholdBytes is null)) { csb.WriteCoalescingBufferThresholdBytes = props.WriteCoalescingBufferThresholdBytes.Value; } if (!(props.WriteCoalescingDelayUs is null)) { csb.WriteCoalescingDelayUs = props.WriteCoalescingDelayUs.Value; } }