/// <summary> /// 重写的OnConfiguring方法 /// </summary> /// <param name="optionsBuilder"></param> protected override void OnConfiguring(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder optionsBuilder) { base.OnConfiguring(optionsBuilder); MySqlConfig useConfig = ConfigPacker.GetConfigPacker().GetConfig <MySqlConfig>(); optionsBuilder.UseMySql(useConfig.Connectstr); }
public void test_connectToDatabase() { Services_OunceV6.startService_MySql(); // check that the connection is working Assert.That(OunceMySql.isConnectionOpen()); // load config and recheck connectoin MySqlConfig.setMySqlConnectionDetailsFromAppConfig(); Assert.That(OunceMySql.refreshDbConnection()); Assert.That(OunceMySql.isConnectionOpen()); // set up a bad pwd OunceMySql.MySqlLoginUsername = "******"; Assert.That(false == OunceMySql.refreshDbConnection()); // reload config and recheck connection MySqlConfig.setMySqlConnectionDetailsFromAppConfig(); Assert.That(OunceMySql.refreshDbConnection()); }
public PaymentRepository(IOptions <MySqlConfig> mySqlConfig, ILogger logger) { _mySqlConfig = mySqlConfig.Value; _logger = logger; }
public ReportServerRepository(MySqlConfig config) { this.connectionString = config.ConnectionString; }
public ContactRepository(IOptions <MySqlConfig> mySqlConfig) { _mySqlConfig = mySqlConfig.Value; }
public AdminChannelRepository(MySqlConfig config) { this.connectionString = config.ConnectionString; }
public SubscribedServerRepository(MySqlConfig config) { this.connectionString = config.ConnectionString; }
public TransactionRepository(IOptions <MySqlConfig> mySqlConfig, IMapper mapper, ILogger logger) { _mySqlConfig = mySqlConfig.Value; _mapper = mapper; _logger = logger; }
public MicroserviceConfig(MySqlConfig defaultMySql, string authAlias) { this.mysql = defaultMySql; this.authAlias = authAlias; }
public ServerServiceFixture WithServerRepository(MySqlConfig config) { serverRepository = new ServerRepository(config); return(this); }
public AppointmentRepository(IOptions<MySqlConfig> mySqlConfig) { _mySqlConfig = mySqlConfig.Value; }
public ChatChannelServerRepository(MySqlConfig config) { this.connectionString = config.ConnectionString; }