public GetAliasService(IRuntimeConfiguration configuration, IRedisDatabaseFactory redisDatabaseFactory, ILogger <GetAliasService> logger, TelemetryClient telemetryClient) { _configuration = configuration; _redisDatabaseFactory = redisDatabaseFactory; _logger = logger; _telemetryClient = telemetryClient; }
public static TextToSpeechConfiguration GetTextToSpeechConfiguration(this IRuntimeConfiguration runtimeConfiguration) { if (textToSpeechConfiguration == null) { textToSpeechConfiguration = TextToSpeechConfiguration.LoadConfiguration(); } return(textToSpeechConfiguration); }
public RestResourceController( IDataProvider dataProvider, IRuntimeConfigurationProvider <IRuntimeConfiguration> runtimeConfigurationProvider, ILogger <RestResourceController <TResource> > logger, IOptions <SnoozleOptions> options) { _dataProvider = dataProvider; _runtimeConfiguration = runtimeConfigurationProvider.GetRuntimeConfigurationForType(typeof(TResource)); _logger = logger; _options = options.Value; }
public MigrationBatch( IEnumerable<IMigrationStep> migrations, IEnumerable<IMigrationMetadata> unidentifiedMigrations, IVersioning versioning, IRuntimeConfiguration configuration) { _migrations = migrations.ToList(); _steps = new ReadOnlyCollection<IMigrationStepMetadata>(_migrations.Select(s => s.Metadata).ToList()); _unidentifiedMigrations = new ReadOnlyCollection<IMigrationMetadata>(unidentifiedMigrations.ToList()); _versioning = versioning; _configuration = configuration; }
public MigrationBatch( IEnumerable <IMigrationStep> migrations, IEnumerable <IMigrationMetadata> unidentifiedMigrations, IVersioning versioning, IRuntimeConfiguration configuration) { _migrations = migrations.ToList(); _steps = new ReadOnlyCollection <IMigrationStepMetadata>(_migrations.Select(s => s.Metadata).ToList()); _unidentifiedMigrations = new ReadOnlyCollection <IMigrationMetadata>(unidentifiedMigrations.ToList()); _versioning = versioning; _configuration = configuration; }
public void Execute(IRuntimeConfiguration configuration, IVersioning versioning) { if (versioning == null) { throw new ArgumentNullException("versioning"); } DateTime start = DateTime.Now; long timestamp = GetTimestamp(); string tag = GetTag(); using (IDbConnection connection = configuration.OpenConnection()) { Debug.Assert(connection.State == ConnectionState.Open); using (IDbTransaction transaction = configuration.ConnectionInfo.SupportsTransactions ? connection.BeginTransaction() : null) { IDbCommandExecutor executor; using ((executor = configuration.SqlDispatcher.CreateExecutor(string.Format(CultureInfo.InvariantCulture, "Migration.{0}.{1}", Metadata.ModuleName, timestamp))) as IDisposable) { try { Execute(configuration.ProviderInfo, connection, transaction, Metadata.Direction, executor); } catch { Log.Error("An non-recoverable error occurred in migration '{0}'{1}{2} while executing {3}.", timestamp, Metadata.ModuleName != MigrationExportAttribute.DefaultModuleName ? " in module '" + Metadata.ModuleName + "'" : string.Empty, tag, Metadata.Direction); throw; } // update versioning versioning.Update(Metadata, connection, transaction, executor); } if (transaction != null) { transaction.Commit(); } } } Log.Verbose(LogCategory.Performance, "Migration of module '{0}' to {1}{2} took {3}s", Metadata.ModuleName, timestamp, tag, (DateTime.Now - start).TotalSeconds); }
public void Execute(IRuntimeConfiguration configuration, IVersioning versioning) { if (versioning == null) throw new ArgumentNullException("versioning"); DateTime start = DateTime.Now; long timestamp = GetTimestamp(); string tag = GetTag(); using (IDbConnection connection = configuration.OpenConnection()) { Debug.Assert(connection.State == ConnectionState.Open); using (IDbTransaction transaction = configuration.ConnectionInfo.SupportsTransactions ? connection.BeginTransaction() : null) { IDbCommandExecutor executor; using ((executor = configuration.SqlDispatcher.CreateExecutor(string.Format(CultureInfo.InvariantCulture, "Migration.{0}.{1}", Metadata.ModuleName, timestamp))) as IDisposable) { try { Execute(configuration.ProviderInfo, connection, transaction, Metadata.Direction, executor); } catch { Log.Error("An non-recoverable error occurred in migration '{0}'{1}{2} while executing {3}.", timestamp, Metadata.ModuleName != MigrationExportAttribute.DefaultModuleName ? " in module '" + Metadata.ModuleName + "'" : string.Empty, tag, Metadata.Direction); throw; } // update versioning versioning.Update(Metadata, connection, transaction, executor); } if (transaction != null) { transaction.Commit(); } } } Log.Verbose(LogCategory.Performance, "Migration of module '{0}' to {1}{2} took {3}s", Metadata.ModuleName, timestamp, tag, (DateTime.Now - start).TotalSeconds); }
protected DbAlterer(string connectionString, DbPlatform dbPlatform, DbAltererOptions options) { if (connectionString == null) { throw new ArgumentNullException("connectionString"); } if (dbPlatform == null) { throw new ArgumentNullException("dbPlatform"); } if (connectionString == null) { throw new ArgumentNullException("connectionString"); } Configuration = CreateRuntimeConfiguration(connectionString, dbPlatform, options); }
internal Versioning(IRuntimeConfiguration configuration, TableName versioningTableName) { _configuration = configuration; _versioningTableName = versioningTableName; _versioningTableExists = new Lazy<bool>(() => { int exists; using (IDbConnection connection = configuration.OpenConnection()) { IDbCommand command = connection.CreateCommand(); command.CommandTimeout = 0; // do not timeout; the client is responsible for not causing lock-outs command.CommandText = configuration.ProviderInfo.Provider.ExistsTable(connection.Database, _versioningTableName); Log.Verbose(LogCategory.Sql, command.CommandText); exists = Convert.ToInt32(command.ExecuteScalar(), CultureInfo.InvariantCulture); } return exists != 0; }); }
internal Versioning(IRuntimeConfiguration configuration, TableName versioningTableName) { _configuration = configuration; _versioningTableName = versioningTableName; _versioningTableExists = new Lazy <bool>(() => { int exists; using (IDbConnection connection = configuration.OpenConnection()) { IDbCommand command = connection.CreateCommand(); command.CommandTimeout = 0; // do not timeout; the client is responsible for not causing lock-outs command.CommandText = configuration.ProviderInfo.Provider.ExistsTable(connection.Database, _versioningTableName); Log.Verbose(LogCategory.Sql, command.CommandText); exists = Convert.ToInt32(command.ExecuteScalar(), CultureInfo.InvariantCulture); } return(exists != 0); }); }
public SqlConnectionFactory(IRuntimeConfiguration runtimeConfiguration) { _runtimeConfiguration = runtimeConfiguration; }
public UnhandledExceptionMiddleware(IRuntimeConfiguration configuration) { _configuration = configuration; }
public RuntimeConfigWrapper(IRuntimeConfiguration configuration) { Configuration = configuration; }
public RedisDatabaseFactory(IRuntimeConfiguration runtimeConfiguration) { _runtimeConfiguration = runtimeConfiguration; }
public ClassIAmTesting(IRuntimeConfiguration runtimeConfig) { _runtimeConfig = runtimeConfig; }
public MigrationBatchPreparer(IMigrationImporter importer, IVersioning versioning, IRuntimeConfiguration configuration) { _importer = importer; _versioning = versioning; _configuration = configuration; }
public LoadGeneratorService(IRuntimeConfiguration runtimeConfiguration) { _runtimeConfiguration = runtimeConfiguration; }
public static IDbConnection OpenConnection(this IRuntimeConfiguration configuration) { return(configuration.ConnectionFactory.OpenConnection(configuration.ConnectionInfo)); }
public static void SetTextToSpeechConfiguration(this IRuntimeConfiguration runtimeConfiguration, TextToSpeechConfiguration ttsConfiguration) { textToSpeechConfiguration = ttsConfiguration; }