| | |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Core.Const; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_Core.Seed; |
| | | using WIDESEAWCS_Core.Tenants; |
| | | |
| | | namespace WIDESEAWCS_Core.DB |
| | |
| | | SqlSugarClient sqlSugarClient = new SqlSugarClient(new ConnectionConfig |
| | | { |
| | | ConfigId = MainDb.CurrentDbConnId, |
| | | ConnectionString = AppSettings.app(MainDb.ConnectionString).DecryptDES(AppSecret.DB), |
| | | ConnectionString = AppSettings.Get(MainDb.ConnectionString).DecryptDES(AppSecret.DB), |
| | | IsAutoCloseConnection = true, |
| | | DbType = MainDb.DbType, |
| | | DbType = DBContext.DbType, |
| | | AopEvents = new AopEvents |
| | | { |
| | | OnError = x => |
| | |
| | | List<MutiDBOperate> listdatabaseSlaveDB = new List<MutiDBOperate>(); |
| | | MutiDBOperate mainDb = new MutiDBOperate() |
| | | { |
| | | Connection = AppSettings.app(MainDb.ConnectionString).DecryptDES(AppSecret.DB), |
| | | Connection = AppSettings.Get(MainDb.ConnectionString).DecryptDES(AppSecret.DB), |
| | | ConnId = MainDb.CurrentDbConnId, |
| | | DbType = DataBaseType.SqlServer |
| | | DbType = DBContext.DbType |
| | | }; |
| | | listdatabaseSlaveDB.Add(mainDb); |
| | | for (int i = 0; i < list.Count; i++) |
| | |
| | | { |
| | | Connection = data.ConnectionString, |
| | | ConnId = data.TenantId + "", |
| | | DbType = (DataBaseType)data.DbType, |
| | | DbType = data.DbType, |
| | | }; |
| | | mutiDBOperate.Connection = mutiDBOperate.Connection.DecryptDES(AppSecret.DB); |
| | | listdatabaseSlaveDB.Add(mutiDBOperate); |
| | |
| | | /// <summary> |
| | | /// 数据库类型 |
| | | /// </summary> |
| | | public DataBaseType DbType { get; set; } |
| | | public DbType DbType { get; set; } |
| | | } |
| | | } |