예제 #1
0
        public override void Build(DbCommandBuilder builder, IServiceProvider serviceProvider)
        {
            builder.SqlBuilder.Write("json_build_object(");
            builder.SqlBuilder.WriteLine();

            ++builder.SqlBuilder.Indent;

            var membersList = members.ToList();

            for (var i = 0; i < membersList.Count; ++i)
            {
                var member    = membersList[i];
                var parameter = builder.AddParameter(member.Key);

                builder.SqlBuilder.Write(parameter.ParameterName);
                builder.SqlBuilder.Write(", ");

                member.Value.Build(builder, serviceProvider);

                if (i < membersList.Count - 1)
                {
                    builder.SqlBuilder.WriteLine(", ");
                }
            }

            --builder.SqlBuilder.Indent;

            builder.SqlBuilder.WriteLine();
            builder.SqlBuilder.Write(")");
        }
예제 #2
0
        public void Build(DbCommandBuilder builder, IServiceProvider serviceProvider)
        {
            builder.SqlBuilder.Write(sql);

            foreach (var parameter in parameters)
            {
                var p = builder.AddParameter(parameter.Value);
                p.ParameterName = parameter.Key;
            }
        }
예제 #3
0
        public void Build(DbCommandBuilder builder, IServiceProvider serviceProvider)
        {
            var parameter = builder.AddParameter(Value);

            builder.SqlBuilder.Write(parameter.ParameterName);
        }