public DatabaseFixture()
        {
            _appSettings = new ConfigurationBuilder()
                           .AddJsonFile("appsettings.json")
                           .Build();

            _connectionString = _appSettings.GetValue <string>("AppSettings:ConnectionString");

            var serviceProvider = new ServiceCollection()
                                  .AddEntityFrameworkInMemoryDatabase()
                                  .BuildServiceProvider();

            var options = new DbContextOptionsBuilder <eFlightDbContext>()
                          .UseInMemoryDatabase(_connectionString)
                          .UseInternalServiceProvider(serviceProvider)
                          .Options;

            Context = new eFlightDbContext(options);
            Seeder  = new TestSeed(Context);

            Seeder.RunSeed();
        }
Beispiel #2
0
 public TestSeed(eFlightDbContext context)
 {
     _context = context;
 }
 public TravelPackageReservationRepository(eFlightDbContext eFlightDbContext) : base(eFlightDbContext)
 {
 }
 public HotelReservationRepository(eFlightDbContext eFlightDbContext) : base(eFlightDbContext)
 {
 }
Beispiel #5
0
 public RepositoryBase(eFlightDbContext eFlightDbContext)
 {
     _context = eFlightDbContext;
 }