Пример #1
0
            public void TestMethod()
            {
                using (FlightManageBookDBContext conetxt = new FlightManageBookDBContext())
                {
                    //5 var contry = _generalRepository.CheckAvailability( DateTime.MinValue,DateTime.MinValue,10).ToList();
                    //  var res = _generalRepository.SearchBookings( DateTime.MinValue,"", "","","").ToList();
                    var res = FlightInfoService.CheckAvailability(new DateTime(2018, 01, 05, 01, 00, 00), new DateTime(2018, 01, 08, 01, 00, 00), 3);

                    IList <PassengerDetail> defaultPassengerDetail = new List <PassengerDetail>();
                    defaultPassengerDetail.Add(new PassengerDetail()
                    {
                        Id = 1, Firstname = "David", Lastname = "Parker", DateOfBirth = new DateTime(1966, 1, 1), PassportNo = "123456", AddressId = 1
                    });
                    defaultPassengerDetail.Add(new PassengerDetail()
                    {
                        Id = 2, Firstname = "Mark", Lastname = "Parker", DateOfBirth = new DateTime(1956, 1, 1), PassportNo = "525666", AddressId = 2
                    });
                    defaultPassengerDetail.Add(new PassengerDetail()
                    {
                        Id = 3, Firstname = "Taylor", Lastname = "Parker", DateOfBirth = new DateTime(1980, 1, 1), PassportNo = "633533", AddressId = 2
                    });

                    IList <BookingDetail> defaultBookingDetail = new List <BookingDetail>();
                    defaultBookingDetail.Add(new BookingDetail()
                    {
                        Id = 1, ScheduleID = 1, Passenger = defaultPassengerDetail
                    });


                    //context.BookingDetail.AddRange(defaultBookingDetail);
                }
            }
Пример #2
0
 public Context()
 {
     if (db == null)
     {
         db = new FlightManageBookDBContext();
     }
 }
Пример #3
0
 public Context(FlightManageBookDBContext context)
 {
     db           = context;
     AddressRepo  = new AddressRepository(context);
     ScheduleRepo = new ScheduleRepository(context);
     flightRepo   = new FlightQueryRepository(context);
 }
Пример #4
0
 public GeneralRepository(FlightManageBookDBContext db)
 {
     if (this.db == null)
     {
         this.db = db;
     }
     entity = db.Set <T>();
 }
Пример #5
0
 public GeneralRepository() : base()
 {
     if (this.db == null)
     {
         this.db = base.db;
     }
     entity = db.Set <T>();
 }
 public FlightQueryRepository(FlightManageBookDBContext db) : base(db)
 {
 }
Пример #7
0
 public AddressRepository(FlightManageBookDBContext db) : base(db)
 {
 }