示例#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();
            }
        }