Beispiel #1
0
        private void DeleteAllData()
        {
            var conn = ConnectionUtil.GetConnectionString();

            using (var connection = ConnectionUtil.CreateConnection(conn))
            {
                connection.Execute($@"
TRUNCATE TABLE `cap.published`;
TRUNCATE TABLE `cap.received`;");
            }
        }
Beispiel #2
0
        private void CreateServiceCollection()
        {
            var services = new ServiceCollection();

            services.AddOptions();
            services.AddLogging();

            _connectionString = ConnectionUtil.GetConnectionString();
            services.AddOptions <CapOptions>();
            services.Configure <MySqlOptions>(x => x.ConnectionString = _connectionString);

            services.AddSingleton <MySqlStorage>();

            _services = services;
        }
Beispiel #3
0
        private void CreateServiceCollection()
        {
            var services = new ServiceCollection();

            services.AddOptions();
            services.AddLogging();

            _connectionString = ConnectionUtil.GetConnectionString();
            services.AddSingleton(new MySqlOptions {
                ConnectionString = _connectionString
            });
            services.AddSingleton <MySqlStorage>();

            _services = services;
        }
Beispiel #4
0
        private void CreateServiceCollection()
        {
            var services = new ServiceCollection();

            services.AddOptions();
            services.AddLogging();

            ConnectionString = ConnectionUtil.GetConnectionString();
            services.AddOptions <CapOptions>();
            services.Configure <MySqlOptions>(x =>
            {
                x.ConnectionString = ConnectionString;
            });
            services.AddSingleton <MySqlDataStorage>();
            services.AddSingleton <IStorageInitializer, MySqlStorageInitializer>();
            _services = services;
        }