Beispiel #1
0
        async Task IMartenStorage.ApplyAllConfiguredChangesToDatabaseAsync(AutoCreate? @override)
        {
            var databases = await Tenancy.BuildDatabases().ConfigureAwait(false);
#if NET6_0_OR_GREATER

            await Parallel.ForEachAsync(databases,
                    async (d, token) => await d.ApplyAllConfiguredChangesToDatabaseAsync().ConfigureAwait(false))
                .ConfigureAwait(false);
#else
            var tasks = databases.Select(x =>
            {
                return Task.Run(() => x.ApplyAllConfiguredChangesToDatabaseAsync());

            }).ToArray();

            await Task.WhenAll(tasks).ConfigureAwait(false);
#endif
        }
Beispiel #2
0
 async ValueTask<IReadOnlyList<IMartenDatabase>> IMartenStorage.AllDatabases()
 {
     var databases = await Tenancy.BuildDatabases().ConfigureAwait(false);
     return databases.OfType<IMartenDatabase>().ToList();
 }