Exemplo n.º 1
0
        public void AddSectionTypes()
        {
            using (BookingSystemDbContext context = new BookingSystemDbContext())
            {
                if (!context.FlightSectionTypes.Where(x => x.FlightSectionName == "First").Any())
                {
                    FlightSectionType first = new FlightSectionType()
                    {
                        FlightSectionName = "First"
                    };
                    context.FlightSectionTypes.Add(first);
                }
                if (!context.FlightSectionTypes.Where(x => x.FlightSectionName == "Economy").Any())
                {
                    FlightSectionType economy = new FlightSectionType()
                    {
                        FlightSectionName = "Economy"
                    };
                    context.FlightSectionTypes.Add(economy);
                }
                if (!context.FlightSectionTypes.Where(x => x.FlightSectionName == "Business").Any())
                {
                    FlightSectionType business = new FlightSectionType()
                    {
                        FlightSectionName = "Business"
                    };
                    context.FlightSectionTypes.Add(business);
                }

                context.SaveChanges();
            }
        }
 public AirportRepository(BookingSystemDbContext context)
 {
     this.context = context;
 }
 public AirportRepository()
 {
     this.context = new BookingSystemDbContext();
 }
Exemplo n.º 4
0
 public FlightRepository(BookingSystemDbContext context)
 {
     this.context = context;
 }
Exemplo n.º 5
0
 public FlightRepository()
 {
     this.context = new BookingSystemDbContext();
 }
Exemplo n.º 6
0
 public SectionRepository(BookingSystemDbContext context)
 {
     this.context = context;
 }
Exemplo n.º 7
0
 public SectionRepository()
 {
     this.context = new BookingSystemDbContext();
 }