public void Delete(DeleteBookingRequest request) { DbBooking dbBooking = new DbBooking(); if (request.Id.HasValue) { dbBooking.Delete(request.Id.Value); } else { throw new Exception("Please enter a valid ID"); } }
public ActionResult DeleteBooking([FromBody] DeleteBookingRequest request) { Console.WriteLine($"Deleting booking"); if (request == null) { Console.WriteLine("Delete booking request was null or invalid"); return(null); } _bookingService.DeleteBooking(request.BookingId, request.Operation); var result = "Request for delete was sent"; return(Ok(result)); }
public async Task <DeleteBookingResponse> DeleteBooking(DeleteBookingRequest request) { bool deleted; using (var db = _provider.GetDatabase()) { var bookings = db.GetCollection <BookingDetails>("bookings"); deleted = bookings.Delete(request.Id); } return(await Task.FromResult(new DeleteBookingResponse { Deleted = deleted })); }
public void Delete(DeleteBookingRequest request) { var bookingCtr = new BookingCtr(); bookingCtr.Delete(request.ID); }