Exemple #1
0
        internal DocumentStore(Configuration configuration, TableMode mode, string connectionString, bool testing)
        {
            Configuration = configuration;
            Logger        = configuration.Logger;

            switch (mode)
            {
            case TableMode.UseRealTables:
                Database = new SqlServerUsingRealTables(this, connectionString);
                break;

            case TableMode.UseTempTables:
                Database = new SqlServerUsingTempTables(this, connectionString);
                break;

            case TableMode.UseTempDb:
                Database = new SqlServerUsingTempDb(this, connectionString);
                break;

            default:
                throw new ArgumentOutOfRangeException("mode", mode, null);
            }

            this.testing = testing;
        }
Exemple #2
0
        internal DocumentStore(TableMode mode, Configuration configuration, bool initialize)
        {
            Configuration = configuration;
            Logger        = configuration.Logger;
            TableMode     = mode;

            switch (mode)
            {
            case TableMode.RealTables:
                Database = new SqlServerUsingRealTables(this, configuration.ConnectionString);
                break;

            case TableMode.GlobalTempTables:
                Database = new SqlServerUsingGlobalTempTables(this, configuration.ConnectionString + ";Initial Catalog=TempDb");
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
            }

            if (initialize)
            {
                Initialize();
            }
        }