示例#1
0
        public void Build(DbCommandBuilder builder, IServiceProvider serviceProvider)
        {
            builder.SqlBuilder.Write("(");

            lhs.Build(builder, serviceProvider);

            builder.SqlBuilder.Write(")::");

            builder.SqlBuilder.Write(columnType.Sql);
        }
示例#2
0
        public void Build(DbCommandBuilder builder, IServiceProvider serviceProvider)
        {
            value.Build(builder, serviceProvider);

            if (Alias != null)
            {
                builder.SqlBuilder.Write(" as ");
                builder.SqlBuilder.Write(Alias);
            }
        }
示例#3
0
        public static void Build(IDbFragment value, string op, bool prefix, DbCommandBuilder builder, IServiceProvider serviceProvider)
        {
            if (prefix)
            {
                builder.SqlBuilder.Write("(");
                builder.SqlBuilder.Write(op);

                builder.SqlBuilder.Write(" (");
                value.Build(builder, serviceProvider);
                builder.SqlBuilder.Write(" ))");
            }
            else
            {
                builder.SqlBuilder.Write("((");
                value.Build(builder, serviceProvider);
                builder.SqlBuilder.Write(") ");

                builder.SqlBuilder.Write(op);
                builder.SqlBuilder.Write(")");
            }
        }
示例#4
0
        public override void Build(DbCommandBuilder builder, IServiceProvider serviceProvider)
        {
            var environmentOption    = serviceProvider.GetRequiredService <EnvironmentOption>();
            var oldEnvironmentOption = environmentOption.Clone();

            environmentOption.IsComparingEquality = true;

            if (lhs == null || lhs is IConstantValue lhsConstant && lhsConstant.Value == null)
            {
                builder.SqlBuilder.Write("((");
                rhs.Build(builder, serviceProvider);

                builder.SqlBuilder.Write($") is{(equal ? "" : " not")} null)");
            }
示例#5
0
        public static void Build(IDbFragment lhs, string op, IDbFragment rhs, DbCommandBuilder builder, IServiceProvider serviceProvider)
        {
            builder.SqlBuilder.Write("(");

            if (op == "=")
            {
                if (lhs is ConstantValue lhsConstant && lhsConstant.Value == null)
                {
                    rhs.Build(builder, serviceProvider);
                    builder.SqlBuilder.Write(" is null");
                }
                else if (rhs is ConstantValue rhsConstant && rhsConstant.Value == null)
                {
                    lhs.Build(builder, serviceProvider);
                    builder.SqlBuilder.Write(" is null");
                }
            }
示例#6
0
 public override void Build(DbCommandBuilder builder, IServiceProvider serviceProvider)
 {
     dbFragment.Build(builder, serviceProvider);
 }
示例#7
0
 public void Build(DbCommandBuilder builder, IServiceProvider serviceProvider)
 {
     fragment.Build(builder, serviceProvider);
 }