Esempio n. 1
0
        public async Task DeleteCardsAsync(IEnumerable <Card> cards, CancellationToken cancellationToken = default)
        {
            if (cards == null)
            {
                throw new ArgumentNullException(nameof(cards));
            }

            foreach (var card in cards)
            {
                await cardRepository.DeleteAsync(card.CreateDtoCard());
            }
        }
Esempio n. 2
0
        public async Task <IActionResult> Delete([FromRoute] Guid id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (Exists(id))
            {
                return(NotFound());
            }

            await cardRepo.DeleteAsync(id);

            return(Ok());
        }