SqlSugar.ResolveExpress.ConstantExpression C# (CSharp) Method

ConstantExpression() private static method

private static ConstantExpression ( Expression exp, MemberType &type, bool isComparisonOperator ) : string
exp System.Linq.Expressions.Expression
type MemberType
isComparisonOperator bool
return string
        private static string ConstantExpression(Expression exp, ref MemberType type, bool? isComparisonOperator)
        {
            type = MemberType.Value;
            ConstantExpression ce = ((ConstantExpression)exp);
            if (ce.Value == null)
                return "null";
            else if (ce.Value.ToString().IsIn("True", "False"))//是bool值
            {
                var ceType = ce.Value.GetType();
                var ceValue = ce.Value.ToString();
                if (isComparisonOperator==true)
                {
                    var ceNewValue = ConstantBoolDictionary.Single(it => it.Type == ceType && it.OldValue.ToLower() == ceValue.ToLower());
                    return ceNewValue.NewValue;
                }
                else
                {
                    var ceNewValue = ConstantBoolDictionary.Single(it => it.Type == ceType && it.OldValue.ToLower() == ceValue.ToLower());
                    return ceNewValue.Key.ToString();
                }
            }
            else
            {
                return ce.Value.ToString();
            }
        }