/// <summary> /// 访问CAST AS表达式。 /// </summary> /// <param name="explicitCastExpression">表达式。</param> /// <returns>返回访问后的表达式实例对象。</returns> public Expression VisitExplicitCast(ExplicitCastExpression explicitCastExpression) { _builder.Append("CAST("); Visit(explicitCastExpression.Operand); _builder.Append(" AS "); var typeMapping = _typeMapper.GetMapping(explicitCastExpression.Type); if (typeMapping == null) { throw new InvalidOperationException(string.Format(Resources.UnsupportedType, explicitCastExpression.Type.DisplayName(false))); } _builder.Append(typeMapping); _builder.Append(")"); return(explicitCastExpression); }