Пример #1
0
        public bool VisitExprDateTimeLiteral(ExprDateTimeLiteral expr, TCtx arg)
        {
            var res = this.Visit(expr, "DateTimeLiteral", arg, out var argOut);

            this.VisitPlainProperty("Value", expr.Value, argOut);
            this._visitor.EndVisitExpr(expr, arg);
            return(res);
        }
Пример #2
0
        public bool VisitExprDateTimeLiteral(ExprDateTimeLiteral dateTimeLiteral, IExpr?parent)
        {
            if (!dateTimeLiteral.Value.HasValue)
            {
                this.AppendNull();
            }
            else
            {
                this.Builder.Append('\'');
                if (dateTimeLiteral.Value.Value.TimeOfDay != TimeSpan.Zero)
                {
                    this.Builder.Append(dateTimeLiteral.Value.Value.ToString("yyyy-MM-ddTHH:mm:ss.fff"));
                }
                else
                {
                    this.Builder.Append(dateTimeLiteral.Value.Value.ToString("yyyy-MM-dd"));
                }
                this.Builder.Append('\'');
            }

            return(true);
        }
Пример #3
0
 public static ExprDateTimeLiteral WithValue(this ExprDateTimeLiteral original, DateTime?newValue)
 => new ExprDateTimeLiteral(value: newValue);
Пример #4
0
 public TRes VisitExprDateTimeLiteral(ExprDateTimeLiteral dateTimeLiteral, ExprValueTypeAnalyzerCtx <TRes, TCtx> ctx)
 {
     return(ctx.ValueVisitor.VisitDateTime(ctx.Ctx, !dateTimeLiteral.Value.HasValue));
 }