Ejemplo n.º 1
0
        /// <summary>
        /// 根据条件获取Dto
        /// </summary>
        /// <typeparam name="TDto"></typeparam>
        /// <param name="condition"></param>
        /// <param name="ignoreFields"></param>
        /// <param name="isWrite"></param>
        /// <returns></returns>
        public TDto GetDto <TDto>(object condition, string[] ignoreFields = null, bool isWrite = false)
        {
            SqlQuery query = SqlQueryUtil.BuilderQuerySqlQuery <TDto>(condition, _tableName);

            return(GetDataAccess(isWrite).QuerySingleOrDefault <TDto>(query));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 查询列表
        /// </summary>
        /// <typeparam name="TDto"></typeparam>
        /// <param name="condition"></param>
        /// <param name="ignoreFields"></param>
        /// <param name="isWrite"></param>
        /// <returns></returns>
        public IEnumerable <TDto> QueryList <TDto>(object condition, string[] ignoreFields = null, string orderBy = "", int top = 0, bool isWrite = false)
        {
            SqlQuery query = SqlQueryUtil.BuilderQuerySqlQuery <TDto>(condition, _tableName, ignoreFields, top: top);

            return(GetDataAccess(isWrite).Query <TDto>(query));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 获取查询列表
        /// </summary>
        /// <param name="isWrite"></param>
        /// <returns></returns>
        public IEnumerable <T> QueryList(bool isWrite = false)
        {
            SqlQuery query = SqlQueryUtil.BuilderQuerySqlQuery <T>(null, _tableName);

            return(GetDataAccess(isWrite).Query <T>(query));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 查询列表
        /// </summary>
        /// <param name="condition"></param>
        /// <param name="isWrite"></param>
        /// <returns></returns>
        public IEnumerable <T> QueryList(object condition, int top = 0, bool isWrite = false)
        {
            SqlQuery query = SqlQueryUtil.BuilderQuerySqlQuery <T>(condition, _tableName, top: top);

            return(GetDataAccess(isWrite).Query <T>(query));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 获取Info
        /// </summary>
        /// <param name="condition"></param>
        /// <param name="ignoreFields"></param>
        /// <param name="isWrite"></param>
        /// <returns></returns>
        public T GetInfo(object condition, string[] ignoreFields = null, bool isWrite = false)
        {
            SqlQuery query = SqlQueryUtil.BuilderQuerySqlQuery(condition, _tableName, ignoreFields);

            return(GetDataAccess().QuerySingleOrDefault <T>(query));
        }