예제 #1
0
        private static void MigrateToLatest(BackgroundTaskOptions taskOptions, DocumentDbOptions dbOptions)
        {
            var runner = new DocumentDbMigrationRunner(dbOptions);

            if (taskOptions.Store.CreateIfNotExists)
            {
                runner.CreateDatabaseIfNotExistsAsync().GetAwaiter().GetResult();
            }

            if (taskOptions.Store.MigrateOnStartup)
            {
                runner.CreateCollectionIfNotExistsAsync().GetAwaiter().GetResult();
            }
        }
예제 #2
0
파일: Add.cs 프로젝트: qiqi545/HQ
        private static void MigrateToLatest(RuntimeOptions runtimeOptions, DocumentDbOptions dbOptions)
        {
            var runner = new DocumentDbMigrationRunner(dbOptions);

            if (runtimeOptions.CreateIfNotExists)
            {
                runner.CreateDatabaseIfNotExistsAsync().GetAwaiter().GetResult();
            }

            if (runtimeOptions.MigrateOnStartup)
            {
                runner.CreateCollectionIfNotExistsAsync().GetAwaiter().GetResult();
            }
        }