public void Setup() { _connection = new SqliteConnection("Datasource=:memory:"); _connection.Open(); _options = new DbContextOptionsBuilder <BarOMeterContext>().UseSqlite(_connection).Options; _context = new BarOMeterContext(_options); _uut = new BarEventRepository(_context); _context.Database.EnsureCreated(); _barEvent = new BarEvent() { BarName = "Katrines Kælder", Date = new DateTime(1997, 01, 01), EventName = "TestEvent", Image = "www.testbillede.dk", }; _barEvent2 = new BarEvent() { BarName = "Katrines Kælder", Date = new DateTime(2019, 01, 01), EventName = "TestEvent2", Image = "www.testbillede.dk", }; }
public void Setup() { _connection = new SqliteConnection("Datasource=:memory:"); _connection.Open(); _options = new DbContextOptionsBuilder <BarOMeterContext>().UseSqlite(_connection).Options; _context = new BarOMeterContext(_options); _uut = new CustomerRepository(_context); _context.Database.EnsureCreated(); }
/// <summary> /// Takes the database context and sends it to the base class constructor (Repository). /// </summary> /// <param name="dbContext"> /// Takes a database context that's gonna be set, so you can access the db. /// </param> public BarEventRepository(BarOMeterContext dbContext) : base(dbContext) { }
/// <summary> /// Takes the database context and sends it to the base class constructor (Repository). /// </summary> /// <param name="dbContext"> /// Takes a database context that's gonna be set, so you can access the db. /// </param> public CouponRepository(BarOMeterContext dbContext) : base(dbContext) { }
/// <summary> /// Takes the database context and sets it for the repository class, so it's the same throughout the /// calls of the class. /// </summary> /// <param name="dbcontext"> /// Takes the database context and sets it in the class. /// </param> public GenericRepository(BarOMeterContext dbcontext) { _dbContext = dbcontext; }
/// <summary> /// Takes the database context and sends it to the base class constructor (Repository). /// </summary> /// <param name="dbContext"> /// Takes a database context that's gonna be set, so you can access the db. /// </param> public CustomerRepository(BarOMeterContext dbContext) : base(dbContext) { }
/// <summary> /// Takes the database context and sends it to the base class constructor (Repository). /// </summary> /// <param name="dbContext"> /// Takes a database context that's gonna be set, so you can access the db. /// </param> public ReviewRepository(BarOMeterContext dbContext) : base(dbContext) { }
/// <summary> /// Takes the database context and sends it to the base class constructor (Repository). /// </summary> /// <param name="dbContext"> /// Takes a database context that's gonna be set, so you can access the db. /// </param> public BarRepresentativeRepository(BarOMeterContext dbContext) : base(dbContext) { }
/// <summary> /// Takes the database context and sends it to the base class constructor (Repository). /// </summary> /// <param name="dbContext"> /// Takes a database context that's gonna be set, so you can access the db. /// </param> public DrinkRepository(BarOMeterContext dbContext) : base(dbContext) { }