コード例 #1
0
        public override void AppendSql([NotNull] StringBuilder builder, [NotNull] GeneratorContext filterParams)
        {
            if (IsValue)
            {
                var value = Value;
                if (value is null)
                {
                    builder.Append("NULL");
                }
                else
                {
                    var paramName = filterParams.Add(Value);
                    builder.Append(Dialect.GetParameterReference(paramName));
                }
            }
            else
            {
                if (!_skipBrackets)
                {
                    builder.Append(Dialect.OpenBracket);
                }

                _left.AppendSql(builder, filterParams);

                builder.Append(" = ");

                _right.AppendSql(builder, filterParams);

                if (!_skipBrackets)
                {
                    builder.Append(Dialect.CloseBracket);
                }
            }
        }
コード例 #2
0
        public override void AppendSql([NotNull] StringBuilder builder, [NotNull] GeneratorContext filterParams)
        {
            var value = Value;

            if (value != null)
            {
                var paramName = filterParams.Add(value);
                builder.Append(Dialect.GetParameterReference(paramName));
            }
            else
            {
                builder.Append("NULL");
            }
        }
コード例 #3
0
        public override void AppendSql([NotNull] StringBuilder builder, [NotNull] GeneratorContext filterParams)
        {
            var value = Value;

            if (value is null)
            {
                builder.Append("NULL");
            }
            else if (_parseHelper.IsSimpleType(value.GetType()))
            {
                builder.Append(value);
            }
            else
            {
                var paramName = filterParams.Add(value);
                builder.Append(Dialect.GetParameterReference(paramName));
            }
        }