Exemplo n.º 1
0
        public HistoryController(IOptions <Config> config)
        {
            this.config = config.Value;
            var databaseProvider = new SqLiteDatabaseProvider(this.config.DatabaseConnectionString);

            historyService = new HistoryService(databaseProvider);
        }
Exemplo n.º 2
0
        public HomeController(IConfiguration configuration, IOptions <Config> config)
        {
            this.config = config.Value;

            var databaseProvider = new SqLiteDatabaseProvider(this.config.DatabaseConnectionString);

            studentService = new StudentService(databaseProvider);
            teamService    = new TeamService(databaseProvider);
            historyService = new HistoryService(databaseProvider);
        }
Exemplo n.º 3
0
        public void VerifySqLiteConnectionStringBuilderGetRightDatabaseProvider()
        {
            SqLiteDatabaseProvider.Register();

            var databaseProvider = new SQLiteConnectionStringBuilder {
                DataSource = "Test.db"
            }.GetDatabaseProvider();

            databaseProvider.Should().BeOfType <SqLiteDatabaseProvider>();

            databaseProvider.ConnectionString.Should().Be("data source=Test.db");
        }