public override void AddSetOfValues(ArrayValueNode valueNode)
        {
            var tmp = new StringBuilder();
            foreach (var value in valueNode.Value)
            {
                if(tmp.Length > 0) tmp.Append(",");

                var param = new DacParameter(GetNextParameterName(), value);
                Params.Add(param);

                tmp.Append(param.Name);
            }

            AddValue(string.Format("({0})", tmp));
        }
Example #2
0
        public virtual void SingleInsertOfUniqueIndex(IStructureIndex uniqueStructureIndex, IStructureSchema structureSchema)
        {
            var sql = StringExtensions.Inject(SqlStatements.GetSql("SingleInsertOfUniqueIndex"), structureSchema.GetUniquesTableName(),
                                              UniqueStorageSchema.Fields.StructureId.Name,
                                              UniqueStorageSchema.Fields.UqStructureId.Name,
                                              UniqueStorageSchema.Fields.UqMemberPath.Name,
                                              UniqueStorageSchema.Fields.UqValue.Name);

            var parameters = new IDacParameter[4];

            parameters[0] = new DacParameter(UniqueStorageSchema.Fields.StructureId.Name, uniqueStructureIndex.StructureId.Value);
            parameters[1] = (uniqueStructureIndex.IndexType == StructureIndexType.UniquePerType)
                                ? new DacParameter(UniqueStorageSchema.Fields.UqStructureId.Name, DBNull.Value)
                                : new DacParameter(UniqueStorageSchema.Fields.UqStructureId.Name, uniqueStructureIndex.StructureId.Value);
            parameters[2] = new DacParameter(UniqueStorageSchema.Fields.UqMemberPath.Name, uniqueStructureIndex.Path);
            parameters[3] = new DacParameter(UniqueStorageSchema.Fields.UqValue.Name, UniquesChecksumGenerator.Instance.Generate(uniqueStructureIndex));

            ExecuteNonQuery(sql, parameters);
        }
        public virtual void AddValue(ValueNode valueNode, string format)
        {
            var param = new DacParameter(GetNextParameterName(), valueNode.Value);
            Params.Add(param);

            AddValue(string.Format(format, param.Name));
        }
        public virtual void AddValue(ValueNode valueNode)
        {
            var param = new DacParameter(GetNextParameterName(), valueNode.Value);
            Params.Add(param);

            AddValue(param.Name);
        }