public async Task <Response> Handle(RemoveParkingRequest request, CancellationToken cancellationToken)
        {
            var parking = await _parkingRepository.GetById(request.Id);

            if (parking == null)
            {
                return(new NotFoundResult($"Parking not found to Parking Id: {request.Id}"));
            }

            _parkingRepository.Delete(parking);
            await _unitOfWork.SaveChangesAsync();

            return(new OkResult($"Parking {request.Id} remove sucessfully"));
        }
 public bool Delete(int id)
 {
     return(parkingRepository.Delete(id));
 }
Пример #3
0
 public void Delete(string name)
 {
     ParkingRepository.Delete(name);
 }
Пример #4
0
 public void Undo()
 {
     parkingRepository.Delete(createdParkingId);
 }