コード例 #1
0
        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",
            };
        }
コード例 #2
0
 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();
 }
コード例 #3
0
 /// <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)
 {
 }
コード例 #4
0
ファイル: CouponRepository.cs プロジェクト: PRJ419/Back-end
 /// <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)
 {
 }
コード例 #5
0
 /// <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;
 }
コード例 #6
0
ファイル: CustomerRepository.cs プロジェクト: PRJ419/Back-end
 /// <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)
 {
 }
コード例 #7
0
ファイル: ReviewRepository.cs プロジェクト: PRJ419/Back-end
 /// <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)
 {
 }
コード例 #8
0
 /// <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)
 {
 }
コード例 #9
0
ファイル: DrinkRepository.cs プロジェクト: PRJ419/Back-end
 /// <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)
 {
 }