Exemple #1
0
        public BillsController(BillVuDbContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            _context = context;
        }
Exemple #2
0
        public DbContextFixture()
        {
            var connection = new SqliteConnection("DataSource=:memory:");

            connection.Open();

            var options = new DbContextOptionsBuilder <BillVuDbContext>()
                          .UseSqlite(connection)
                          .Options;

            DbContext = new BillVuDbContext(options);

            DbContext.Database.EnsureCreated();
        }