using Bit.SeederApi.Commands.Interfaces; namespace Bit.SeederApi.Commands; public class DestroyBatchScenesCommand( ILogger logger, IDestroySceneCommand destroySceneCommand) : IDestroyBatchScenesCommand { public async Task DestroyAsync(IEnumerable playIds) { var exceptions = new List(); foreach (var playId in playIds) { try { await destroySceneCommand.DestroyAsync(playId); } catch (Exception ex) { exceptions.Add(ex); logger.LogError(ex, "Error deleting seeded data: {PlayId}", playId); } } if (exceptions.Count > 0) { throw new AggregateException("One or more errors occurred while deleting seeded data", exceptions); } } }