Exemplo n.º 1
0
        public async Task AddManyAsync(IEnumerable <WebhookDefinition> entities, CancellationToken cancellationToken = default)
        {
            var list = entities.ToList();

            foreach (var entity in list)
            {
                Initialize(entity);
            }

            await _store.AddManyAsync(list, cancellationToken);
        }
        public async Task AddManyAsync(IEnumerable <WebhookDefinition> entities, CancellationToken cancellationToken = default)
        {
            var list = entities.ToList();

            foreach (var entity in list)
            {
                await _mediator.Publish(new WebhookDefinitionSaving(entity), cancellationToken);
            }

            await _store.AddManyAsync(list, cancellationToken);

            foreach (var entity in list)
            {
                await _mediator.Publish(new WebhookDefinitionSaved(entity), cancellationToken);
            }
        }