Example #1
0
        /// <summary>
        /// 欄位值為 NULL
        /// </summary>
        /// <typeparam name="TSource"></typeparam>
        /// <typeparam name="T"></typeparam>
        /// <param name="model"></param>
        /// <param name="exp"></param>
        /// <returns></returns>
        public static TSource IsNull <TSource, T>(this TSource model, Expression <Func <TSource, T> > exp)
            where TSource : IDBEntity
        {
            OperatingField field = new OperatingField()
            {
                COLUMN_NAME = ((MemberExpression)exp.Body).Member.Name,
                OPERATOR    = "IS",
                VALUE       = "NULL"
            };

            model.GetOperating().WHERE_LIST.Add(field);

            return(model);
        }
Example #2
0
        //====================================================================
        //條件式
        //====================================================================
        /// <summary>
        ///
        /// </summary>
        /// <typeparam name="TSource"></typeparam>
        /// <typeparam name="T"></typeparam>
        /// <param name="model"></param>
        /// <param name="exp"></param>
        /// <param name="OPERATOR"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        private static TSource AddWhereOperating <TSource, T>(
            this TSource model, Expression <Func <TSource, T> > exp, string OPERATOR, T value)
            where TSource : IDBEntity
        {
            OperatingField field = new OperatingField()
            {
                COLUMN_NAME = ((MemberExpression)exp.Body).Member.Name,
                OPERATOR    = OPERATOR,
                VALUE       = value
            };

            model.GetOperating().WHERE_LIST.Add(field);

            return(model);
        }