public void Delete(Reservation entity) { context.Reservations.Find(entity.ReservationId); if (entity.DepartFlightScheduleID != 0) { context.Entry(entity.DepartureFlight).State = EntityState.Deleted; } if (entity.ReturnFlightScheduleID != 0) { context.Entry(entity.ReturnFlight).State = EntityState.Deleted; } context.Reservations.Remove(entity); }
public void Edit(Location entity) { var originalEntity = context.Locations.Find(entity.LocationId); context.Entry(originalEntity).CurrentValues.SetValues(entity); }
public void Edit(Flight entity) { var originalEntity = context.Flights.Find(entity.FlightId); context.Entry(originalEntity).CurrentValues.SetValues(entity); }
public void Edit(Traveler entity) { var originalEntity = context.Travelers.Find(entity.TravelerId); context.Entry(originalEntity).CurrentValues.SetValues(entity); }