public EfDbSetWrapper(AirTicketEfDbContext efDbContext) { Guard.WhenArgument(efDbContext, "efDbContext").IsNull().Throw(); this.efDbContext = efDbContext; this.dbSet = efDbContext.Set <T>(); }
public void TestCleanup() { AirTicketEfDbContext dbContext = kernel.Get <AirTicketEfDbContext>(); dbContext.Airlines.Attach(dbAirline); dbContext.Airlines.Remove(dbAirline); dbContext.SaveChanges(); }
public void TestInit() { kernel = NinjectWebCommon.CreateKernel(); AirTicketEfDbContext dbContext = kernel.Get <AirTicketEfDbContext>(); dbContext.Airlines.Add(dbAirline); dbContext.SaveChanges(); dbContext.Airports.Add(dbAirport); dbContext.SaveChanges(); //var airline = dbContext.Airlines.FirstOrDefault(); //dbFlight.AirlineId = airline.Id; //dbFlight.Airline = airline; dbContext.Flights.Add(dbFlight); dbContext.SaveChanges(); }