コード例 #1
0
        /// <summary>
        /// 生成获取列表的SQL
        /// </summary>
        /// <param name="entityType"></param>
        /// <param name="predicate"></param>
        /// <param name="sort"></param>
        /// <returns></returns>
        public string GetList(Type entityType, IPredicate predicate, IList <ISort> sort)
        {
            var classMap   = _configuration.GetMap(entityType);
            var parameters = new Dictionary <string, object>();
            var generator  = SqlFactory.GetSqlGenerator(_configuration);

            return(generator.Select(classMap, predicate, sort, parameters));
        }
コード例 #2
0
        /// <summary>
        /// 生成分页SQL
        /// </summary>
        /// <param name="entityType"></param>
        /// <param name="predicate"></param>
        /// <param name="sort"></param>
        /// <param name="page"></param>
        /// <param name="resultsPerPage"></param>
        /// <returns></returns>
        public string GetPagingWithMySql(Type entityType, IPredicate predicate, IList <ISort> sort, int page, int resultsPerPage)
        {
            var classMap   = _configuration.GetMap(entityType);
            var parameters = new Dictionary <string, object>();
            var generator  = SqlFactory.GetSqlGenerator(_configuration);

            return(generator.SelectPaged(classMap, predicate, sort, page, resultsPerPage, parameters));
        }