public SqlDbContext(string connectionString_Read, string connectionString_ReadWrite, DataBaseType dataBaseType) : base(dataBaseType) { DbHelper.ConnString_R = connectionString_Read; DbHelper.ConnString_RW = connectionString_ReadWrite; DbHelper.DbType = dataBaseType; DataBaseName = DataBaseAttribute.GetName(typeof(TDataBase)); }
protected OracleDbContext(string connectionString_Write, params string[] connectionString_Read) : base(connectionString_Write, connectionString_Read) { //add write connection to cache GetDbConnection(connectionString_Write); this.DataBaseType = CoffeeSql.Core.Configs.DataBaseType.Oracle; this.DataBaseName = DataBaseAttribute.GetName(typeof(TDataBase)); }
protected NoSqlDbContext(DataBaseType dataBaseType, string connectionString) : base(dataBaseType) { switch (dataBaseType) { case DataBaseType.MongoDB: Client = new MongoClient(connectionString); break; default: break; } DataBaseName = DataBaseAttribute.GetName(typeof(TDataBase)); }
protected SqlServerDbContext(string connectionString_Write, params string[] connectionStrings_Read) : base(connectionString_Write, connectionStrings_Read) { DataBaseType = DataBaseType.SqlServer; DataBaseName = DataBaseAttribute.GetName(typeof(TDataBase)); }
protected NoSqlDbContext(MongoClientSettings mongoClientSettings) : base(DataBaseType.MongoDB) { Client = new MongoClient(mongoClientSettings); DataBaseName = DataBaseAttribute.GetName(typeof(TDataBase)); }
/// <summary> /// 上下文赋值 /// </summary> private void SetContext() { DataBaseType = DataBaseType.MongoDB; DataBaseName = DataBaseAttribute.GetName(typeof(TDataBase)); }
protected MysqlDbContext(string connectionString_Write, params string[] connectionString_Read) : base(connectionString_Write, connectionString_Read) { this.DataBaseType = CoffeeSql.Core.Configs.DataBaseType.MySql; this.DataBaseName = DataBaseAttribute.GetName(typeof(TDataBase)); }