public void UpdateKeywordReservation(KeywordReservation keywordReservation) { using (var connection = _databaseService.Connect()) { var rsv = connection.Reservations.SingleOrDefault(w => w.ReservationId == keywordReservation.Reservation.ReservationId); if (rsv == null) { throw new InvalidOperationException(); } rsv.KeywordReservation.Merge(keywordReservation); connection.DetectChanges(); connection.SaveChanges(); } }
public void DeleteKeywordReservation(KeywordReservation keywordReservation) { keywordReservation.Reservation.IsEnabled = false; UpdateKeywordReservation(keywordReservation); }