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(); }
public FlightRepository(BookingSystemDbContext context) { this.context = context; }
public FlightRepository() { this.context = new BookingSystemDbContext(); }
public SectionRepository(BookingSystemDbContext context) { this.context = context; }
public SectionRepository() { this.context = new BookingSystemDbContext(); }