public static async Task AddOrUpdateAlertRangeSavingChanges(this DbSet <AlertStoreItem> dbSet, List <Alert> items) { foreach (var item in items ?? throw new ArgumentNullException(nameof(items))) { dbSet.AddOrUpdateAlert(item); await dbSet.GetContext() .SaveChangesAsync() .ConfigureAwait(false); } }