private static Tuple <List <MutiDbOperate>, List <MutiDbOperate> > MutiInitConn() { List <MutiDbOperate> dbOperates = AppSettingHelper.GetSection <MutiDbOperate>(SystemHelper.DBS).Where(item => item.Enabled).ToList(); List <MutiDbOperate> operateFirst = new List <MutiDbOperate>(); List <MutiDbOperate> operateSecond = new List <MutiDbOperate>(); bool isMutiFlag = AppSettingHelper.GetSection(SystemHelper.MutiDBEnabled).ObjToBool(); bool isCQRSFlag = AppSettingHelper.GetSection(SystemHelper.CQRSEnabled).ObjToBool(); if (isMutiFlag) { operateFirst = dbOperates; } else { if (isCQRSFlag) { operateSecond = dbOperates.Where(item => item.ConnId != CurrentDbConnId).ToList(); } else { MutiDbOperate dbOperate = dbOperates.FirstOrDefault(item => item.ConnId == CurrentDbConnId); if (dbOperate == null) { dbOperate = dbOperates.FirstOrDefault(); } operateFirst.Add(dbOperate); } } return(new Tuple <List <MutiDbOperate>, List <MutiDbOperate> >(operateFirst, operateSecond)); }
private static string InitAudienceSecret() { string secret = AppSettingHelper.GetSection(SecretGroup); string secretFile = AppSettingHelper.GetSection(SecretFileGroup); string secretKey = secret; if (!string.IsNullOrEmpty(secretFile)) { if (File.Exists(secretFile)) { string readSecret = File.ReadAllText(secretFile); if (!string.IsNullOrEmpty(readSecret)) { secretKey = readSecret; } } } return(secretKey); }
private static string CurrentDbConn() { return(AppSettingHelper.GetSection(SystemHelper.MainDB).ObjToString()); }