Example #1
0
        /// <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));
        }
Example #2
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="type"></param>
 public DbContext(Entity.ContextType type)
     : base(getConn(type))
 {
 }