/// <summary> /// 获取链接字符 /// </summary> /// <param name="type"></param> /// <returns></returns> private static string getConn(Entity.ContextType type) { var connectionString = readConn; if (type == Entity.ContextType.update) { connectionString = updateConn; } return(string.Format("name={0}", connectionString)); }
/// <summary> /// 构造函数 /// </summary> /// <param name="type"></param> public DbContext(Entity.ContextType type) : base(getConn(type)) { }