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

            _context = context;
        }
示例#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();
        }