Beispiel #1
0
        private static void NewPilots()
        {
            using (var ctx = new WWWingsContext())
            {
                Pilot p1 = new Pilot {
                    Surname = "Bono", GivenName = "Jean", Salary = 23000
                };

                ctx.PilotSet.Add(p1);

                Pilot p2 = new Pilot {
                    Surname = "Tilde", GivenName = "Pierre", Salary = 4800
                };

                ctx.PilotSet.Add(p2);

                ctx.SaveChanges();
            }
        }
Beispiel #2
0
 public static void NewBooking()
 {
     using (var ctx = new WWWingsContext())
     {
         ctx.BookingSet.Add(new Booking {
             FlightNo = 1, PassengerID = 1, PricePaid = 50
         });
         ctx.BookingSet.Add(new Booking {
             FlightNo = 1, PassengerID = 2, PricePaid = 40
         });
         ctx.BookingSet.Add(new Booking {
             FlightNo = 2, PassengerID = 3, PricePaid = 50
         });
         ctx.BookingSet.Add(new Booking {
             FlightNo = 2, PassengerID = 4, PricePaid = 90
         });
         ctx.SaveChanges();
     }
 }