Ejemplo n.º 1
0
        public async Task <Unit> Handle(DeleteCommand request, CancellationToken cancellationToken)
        {
            var car = await _carRepository.GetACarAsync(request.Id);

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

            await _carRepository.DeleteACarAsync(request.Id);

            return(Unit.Value);
        }