コード例 #1
0
ファイル: AndEx.cs プロジェクト: BestHYC/MyDAL
        /*************************************************************************************************************************************/

        /// <summary>
        /// 与条件
        /// </summary>
        /// <param name="func">格式: it => it.CreatedOn >= WhereTest.DateTime_大于等于</param>
        public static WhereQ <M> And <M>(this WhereQ <M> where, Expression <Func <M, bool> > compareFunc)
            where M : class
        {
            where.DC.Action = ActionEnum.And;
            where.AndHandle(compareFunc);
            return(where);
        }
コード例 #2
0
ファイル: WhereEx.cs プロジェクト: hpc-dal/HPC.DAL
 /// <summary>
 /// 请参阅: <see langword=".Where() &amp; .And() &amp; .Or() 使用 https://www.cnblogs.com/Meng-NET/"/>
 /// </summary>
 public static WhereQ <M> Or <M>(this WhereQ <M> where, Expression <Func <M, bool> > compareFunc)
     where M : class
 {
     where.DC.Action = ActionEnum.Or;
     where.ST_WhereAndOr(compareFunc);
     return(where);
 }
コード例 #3
0
 public static OrderByQ <M> OrderBy <M>(this WhereQ <M> where, IEnumerable <string> orderBys)
     where M : class
 {
     where.DC.Action = ActionEnum.OrderBy;
     where.OrderByM <M>(orderBys);
     return(new OrderByQ <M>(where.DC));
 }
コード例 #4
0
        /**************************************************************************************************************/

        public static OrderByQ <M> OrderBy <M, F>(this WhereQ <M> where, Expression <Func <M, F> > propertyFunc, OrderByEnum orderBy = OrderByEnum.Desc)
            where M : class
        {
            where.DC.Action = ActionEnum.OrderBy;
            where.OrderByMF(propertyFunc, orderBy);
            return(new OrderByQ <M>(where.DC));
        }
コード例 #5
0
        /// <summary>
        /// select count(column)
        /// </summary>
        /// <param name="func">格式: it => it.Id</param>
        public static CountQ <M> Count <M, F>(this WhereQ <M> where, Expression <Func <M, F> > func)
        {
            var keyDic = where.DC.EH.ExpressionHandle(func)[0];
            var key    = keyDic.ColumnOne;

            where.DC.AddConditions(new DicModel
            {
                ColumnOne = key,
                Param     = key,
                ParamRaw  = key,
                Action    = ActionEnum.Select,
                Option    = OptionEnum.Count,
                Crud      = CrudTypeEnum.Query
            });
            return(new CountQ <M>(where.DC));
        }
コード例 #6
0
ファイル: DistinctEx.cs プロジェクト: yunyongtech/Yunyong
 public static DistinctQ <M> Distinct <M>(this WhereQ <M> where)
     where M : class
 {
     where.DistinctHandle();
     return(new DistinctQ <M>(where.DC));
 }
コード例 #7
0
        /****************************************************************************************************************************************/

        /// <summary>
        /// 或条件
        /// </summary>
        /// <param name="func">格式: it => it.AgentLevel == testQ.AgentLevelXX</param>
        public static WhereQ <M> Or <M>(this WhereQ <M> where, Expression <Func <M, bool> > func)
        {
            where.DC.OP.OrHandle(func, CrudTypeEnum.Query);
            return(where);
        }
コード例 #8
0
        /**************************************************************************************************************/

        public static OrderByQ <M> OrderBy <M, F>(this WhereQ <M> where, Expression <Func <M, F> > func, OrderByEnum orderBy = OrderByEnum.Desc)
        {
            where.DC.OP.OrderByHandle(func, orderBy);
            return(new OrderByQ <M>(where.DC));
        }
コード例 #9
0
ファイル: OrderByEx.cs プロジェクト: liumeng0403/MyDAL
 public static OrderByQ <M> OrderBy <M, F>(this WhereQ <M> target, Expression <Func <M, F> > propertyFunc, OrderByEnum orderBy = OrderByEnum.Desc)
     where M : class
 {
     return(OrderByQ(target, propertyFunc, orderBy));
 }