public object GetModelList(string sql)
        {
            ComSQLRepository comsql = new ComSQLRepository();
            object           o      = comsql.GetSingle(sql.ToString());

            return(o);
        }
Example #2
0
        /// <summary>
        /// 保证了线程内DbSession实例唯一
        /// </summary>
        /// <returns></returns>
        ///
        public static ComSQLRepository GetCurrentDbSession()
        {
            ComSQLRepository _dbSession = CallContext.GetData("DbSession") as ComSQLRepository;

            if (_dbSession == null)
            {
                _dbSession = new ComSQLRepository();
                CallContext.SetData("DbSession", _dbSession);
            }

            return(_dbSession);
        }