public async Task DeleteAsync(int id) { Rooms tracked = _db.Rooms.Find(id); if (tracked == null) { throw new ArgumentException("No Room with this id", nameof(id)); } _db.Remove(tracked); }
public async Task DeleteAsync(int id) { //Events tracked = Mapper.Map<Event, Events>(GetById(id)); Events tracked = _db.Events.Find(id); if (tracked == null) { throw new ArgumentException("No Event with this id", nameof(id)); } _db.Remove(tracked); }
public async Task DeleteAsync(int id) { //Customers tracked = Mapper.Map<Customer, Customers>(GetById(id)); Customers tracked = _db.Customers.Find(id); if (tracked == null) { throw new ArgumentException("No Customer with this id", nameof(id)); } _db.Remove(tracked); }
public async Task DeleteAsync(int id) { //Reservations tracked = Mapper.Map<Reservation, Reservations>(GetById(id)); Reservations tracked = _db.Reservation.Find(id); if (tracked == null) { throw new ArgumentException("No Reservation with this id", nameof(id)); } _db.Remove(tracked); }