コード例 #1
0
 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);
 }
コード例 #2
0
        public void Edit(Location entity)
        {
            var originalEntity = context.Locations.Find(entity.LocationId);

            context.Entry(originalEntity).CurrentValues.SetValues(entity);
        }
コード例 #3
0
        public void Edit(Flight entity)
        {
            var originalEntity = context.Flights.Find(entity.FlightId);

            context.Entry(originalEntity).CurrentValues.SetValues(entity);
        }
コード例 #4
0
        public void Edit(Traveler entity)
        {
            var originalEntity = context.Travelers.Find(entity.TravelerId);

            context.Entry(originalEntity).CurrentValues.SetValues(entity);
        }