/// <summary>
        /// 添加一个Update操作
        /// </summary>
        /// <param name="condition"></param>
        /// <param name="primaryKey"></param>
        /// <param name="updateAttributes"></param>
        public void AddUpdate(Condition condition, PrimaryKey primaryKey, UpdateOfAttribute updateAttributes)
        {
            var item = new RowUpdateChange(TableName, primaryKey)
            {
                Condition = condition
            };

            item.FromUpdateOfAtrribute(updateAttributes);

            RowUpdateChanges.Add(item);
        }
        public RowUpdateChange FromUpdateOfAtrribute(UpdateOfAttribute updateOfAttribute)
        {
            if (updateOfAttribute.AttributeColumnsToDelete != null)
            {
                foreach (var attributeColumnToDelete in updateOfAttribute.AttributeColumnsToDelete)
                {
                    this.DeleteColumn(attributeColumnToDelete);
                }
            }

            if (updateOfAttribute.AttributeColumnsToPut != null)
            {
                foreach (var attributeColumnToPut in updateOfAttribute.AttributeColumnsToPut)
                {
                    this.Put(attributeColumnToPut.Key, attributeColumnToPut.Value);
                }
            }

            return(this);
        }
Пример #3
0
        /// <summary>
        /// 添加一个Update操作
        /// </summary>
        /// <param name="condition"></param>
        /// <param name="primaryKey"></param>
        /// <param name="updates"></param>
        public void AddUpdate(Condition condition, PrimaryKey primaryKey, UpdateOfAttribute updates)
        {
            var item = new Tuple <Condition, PrimaryKey, UpdateOfAttribute>(condition, primaryKey, updates);

            UpdateOperations.Add(item);
        }