コード例 #1
0
        public virtual string DealExpression(Expression exp, bool need = false)
        {
            string name = exp.GetType().Name;

            if (!name.Equals(this.ExpressionName))
            {
                IExpressionHandle expression = serverFactory.NewExpressionHandle(name);
                return(expression.DealExpression(exp));
            }
            return("");
        }
コード例 #2
0
        /// <summary>
        /// 获取SQL
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="TKey"></typeparam>
        /// <param name="exp"></param>
        /// <returns></returns>
        public string GetSql <T>(Expression <Func <T, bool> > exp)
        {
            Expression ex   = exp.Body;
            string     name = ex.GetType().Name;

            expressionHandle = serverFactory.NewExpressionHandle(name);
            if (expressionHandle != null)
            {
                return(expressionHandle.DealExpression(ex));
            }
            return("error");
        }