public static async Task ExecuteScopeAsync(Func <IServiceProvider, Task> action)
        {
            using (IServiceScope scope = s_scopeFactory.CreateScope())
            {
                HercPwaDbContext dbContext = scope.ServiceProvider.GetService <HercPwaDbContext>();

                try
                {
                    await dbContext.BeginTransactionAsync().ConfigureAwait(false);

                    await action(scope.ServiceProvider).ConfigureAwait(false);

                    await dbContext.CommitTransactionAsync().ConfigureAwait(false);
                }
                catch (Exception)
                {
                    dbContext.RollbackTransaction();
                    throw;
                }
            }
        }