public override LiteralExpression VisitLiteralValue(LiteralExpression expression) { _xmlWriter.WriteStartElement("literalExpression"); _xmlWriter.WriteStartElement("value"); WriteTypeAttribute(expression.ExpressionType); object value = expression.GetValue(); if (NullHelper.IsNull(value)) { _xmlWriter.WriteAttributeString("value", "<null>"); } else { _xmlWriter.WriteAttributeString("value", value.ToString()); } _xmlWriter.WriteEndElement(); _xmlWriter.WriteEndElement(); return(expression); }
public override LiteralExpression VisitLiteralValue(LiteralExpression expression) { _ilEmitContext.AddParameter(expression, expression.GetValue(), expression.ExpressionType); return(expression); }
private static bool VisitLiteralValue(LiteralExpression node1, LiteralExpression node2) { return node2 != null && Equals(node1.GetValue(), node2.GetValue()); }
private static bool VisitLiteralValue(LiteralExpression node1, LiteralExpression node2) { return(node2 != null && Equals(node1.GetValue(), node2.GetValue())); }
public override LiteralExpression VisitLiteralValue(LiteralExpression expression) { if (expression.GetValue() == null) _writer.WriteNull(); else { switch (expression.PrimitiveType) { case PrimitiveType.None: if (expression.ExpressionType != typeof(DateTime)) goto case PrimitiveType.Object; _writer.WriteLiteral(expression.AsDateTime); break; case PrimitiveType.Object: _writer.WriteLiteral(expression.GetValue()); break; case PrimitiveType.Boolean: _writer.WriteLiteral(expression.AsBoolean); break; case PrimitiveType.Byte: case PrimitiveType.SByte: case PrimitiveType.Int16: case PrimitiveType.UInt16: case PrimitiveType.UInt32: case PrimitiveType.UInt64: _writer.WriteLiteral(expression.AsInt64, expression.ExpressionType); break; case PrimitiveType.Int32: case PrimitiveType.Int64: _writer.WriteLiteral(expression.AsInt64); break; case PrimitiveType.Char: _writer.WriteLiteral(expression.AsString[0]); break; case PrimitiveType.String: _writer.WriteLiteral(expression.AsString); break; case PrimitiveType.Single: case PrimitiveType.Decimal: _writer.WriteLiteral(expression.AsDouble, expression.ExpressionType); break; case PrimitiveType.Double: _writer.WriteLiteral(expression.AsDouble); break; default: throw ExceptionBuilder.UnhandledCaseLabel(expression.PrimitiveType); } } return expression; }
public override LiteralExpression VisitLiteralValue(LiteralExpression expression) { if (expression.GetValue() == null) { _writer.WriteNull(); } else { switch (expression.PrimitiveType) { case PrimitiveType.None: if (expression.ExpressionType != typeof(DateTime)) { goto case PrimitiveType.Object; } _writer.WriteLiteral(expression.AsDateTime); break; case PrimitiveType.Object: _writer.WriteLiteral(expression.GetValue()); break; case PrimitiveType.Boolean: _writer.WriteLiteral(expression.AsBoolean); break; case PrimitiveType.Byte: case PrimitiveType.SByte: case PrimitiveType.Int16: case PrimitiveType.UInt16: case PrimitiveType.UInt32: case PrimitiveType.UInt64: _writer.WriteLiteral(expression.AsInt64, expression.ExpressionType); break; case PrimitiveType.Int32: case PrimitiveType.Int64: _writer.WriteLiteral(expression.AsInt64); break; case PrimitiveType.Char: _writer.WriteLiteral(expression.AsString[0]); break; case PrimitiveType.String: _writer.WriteLiteral(expression.AsString); break; case PrimitiveType.Single: case PrimitiveType.Decimal: _writer.WriteLiteral(expression.AsDouble, expression.ExpressionType); break; case PrimitiveType.Double: _writer.WriteLiteral(expression.AsDouble); break; default: throw ExceptionBuilder.UnhandledCaseLabel(expression.PrimitiveType); } } return(expression); }
public override LiteralExpression VisitLiteralValue(LiteralExpression expression) { _ilEmitContext.AddParameter(expression, expression.GetValue(), expression.ExpressionType); return expression; }
public override LiteralExpression VisitLiteralValue(LiteralExpression expression) { _xmlWriter.WriteStartElement("literalExpression"); _xmlWriter.WriteStartElement("value"); WriteTypeAttribute(expression.ExpressionType); object value = expression.GetValue(); if (NullHelper.IsNull(value)) _xmlWriter.WriteAttributeString("value", "<null>"); else _xmlWriter.WriteAttributeString("value", value.ToString()); _xmlWriter.WriteEndElement(); _xmlWriter.WriteEndElement(); return expression; }