Ejemplo n.º 1
0
    public async Task Install(string identity)
    {
        var connectionBuilder = settings.GetConnectionBuilder();
        var sqlVariant        = settings.GetSqlVariant();
        var schema            = settings.GetSchema();
        var scriptDirectory   = ScriptLocation.FindScriptDirectory(sqlVariant);
        var tablePrefix       = settings.GetTablePrefix();

        ConfigValidation.ValidateTableSettings(sqlVariant, tablePrefix, schema);

        using (var connection = await connectionBuilder.OpenConnection().ConfigureAwait(false))
            using (var transaction = connection.BeginTransaction())
            {
                await InstallOutbox(scriptDirectory, connection, transaction, tablePrefix, schema, sqlVariant).ConfigureAwait(false);
                await InstallSagas(scriptDirectory, connection, transaction, tablePrefix, schema, sqlVariant).ConfigureAwait(false);
                await InstallSubscriptions(scriptDirectory, connection, transaction, tablePrefix, schema, sqlVariant).ConfigureAwait(false);
                await InstallTimeouts(scriptDirectory, connection, transaction, tablePrefix, schema, sqlVariant).ConfigureAwait(false);

                transaction.Commit();
            }
    }