public void Process(DbMethodCallExpression exp, SqlGenerator generator) { if (exp.Object.Type == PublicConstants.TypeOfString) { exp.Object.Accept(generator); return; } DbConvertExpression c = DbExpression.Convert(exp.Object, PublicConstants.TypeOfString); c.Accept(generator); }
static void Method_ToString(DbMethodCallExpression exp, SqlGenerator generator) { if (exp.Method.Name != "ToString" && exp.Arguments.Count != 0) { throw UtilExceptions.NotSupportedMethod(exp.Method); } if (exp.Object.Type == UtilConstants.TypeOfString) { exp.Object.Accept(generator); return; } if (!NumericTypes.ContainsKey(exp.Object.Type.GetUnderlyingType())) { throw UtilExceptions.NotSupportedMethod(exp.Method); } DbConvertExpression c = DbExpression.Convert(exp.Object, UtilConstants.TypeOfString); c.Accept(generator); }
public override DbExpression Visit(DbConvertExpression exp) { return(exp.Accept(this._generator)); }