Example #1
0
        public async Task <Unit> Handle(DeleteAttractionCommand request, CancellationToken cancellationToken)
        {
            var attraction = await _attractionRepository.GetByIdAsync(request.Id);

            if (attraction == null)
            {
                throw new NotFoundException(nameof(Attraction), request.Id.ToString());
            }

            await _attractionRepository.DeleteAsync(attraction);

            return(Unit.Value);
        }