static GDBContextManager() { cache = new Dictionary <string, GDBContext>(); DBConfigReader reader = new DBConfigReader(); Dictionary <string, string> dicDB = reader.Read(); foreach (string key in dicDB.Keys) { string conStr = dicDB[key]; GDBContext db = new GDBContext(conStr); cache[key] = db; } }
static GDBContext Creater(string Year) { DBConfigReader reader = new DBConfigReader(); Dictionary <string, string> dicDB = reader.Read(); if (!dicDB.ContainsKey(Year)) { throw new AngleX.CustomException("无法找到数据源"); } string conStr = dicDB[Year]; GDBContext db = new GDBContext(conStr); return(db); }