Exemplo n.º 1
0
        private void WriteDelete(Utf8JsonWriter writer, TransactDeleteItem deleteItem)
        {
            writer.WritePropertyName("Delete");

            writer.WriteStartObject();

            writer.WriteTableName(_tablePrefix, deleteItem.TableName);

            if (deleteItem.ConditionExpression != null)
            {
                writer.WriteString("ConditionExpression", deleteItem.ConditionExpression);
            }

            if (deleteItem.ExpressionAttributeNames != null)
            {
                writer.WriteExpressionAttributeNames(deleteItem.ExpressionAttributeNames);
            }

            if (deleteItem.ExpressionAttributeValues != null)
            {
                writer.WriteExpressionAttributeValues(deleteItem.ExpressionAttributeValues);
            }

            if (deleteItem.Key != null)
            {
                writer.WritePrimaryKey(deleteItem.Key);
            }

            if (deleteItem.ReturnValuesOnConditionCheckFailure != ReturnValuesOnConditionCheckFailure.None)
            {
                writer.WriteReturnValuesOnConditionCheckFailure(deleteItem.ReturnValuesOnConditionCheckFailure);
            }

            writer.WriteEndObject();
        }
Exemplo n.º 2
0
        private static void WriteConditionCheck(Utf8JsonWriter writer, ConditionCheck conditionCheck)
        {
            writer.WritePropertyName("ConditionCheck");

            writer.WriteStartObject();

            if (conditionCheck.ConditionExpression != null)
            {
                writer.WriteString("ConditionExpression", conditionCheck.ConditionExpression);
            }

            if (conditionCheck.ExpressionAttributeNames != null)
            {
                writer.WriteExpressionAttributeNames(conditionCheck.ExpressionAttributeNames);
            }

            if (conditionCheck.ExpressionAttributeValues != null)
            {
                writer.WriteExpressionAttributeValues(conditionCheck.ExpressionAttributeValues);
            }

            if (conditionCheck.Key != null)
            {
                writer.WritePrimaryKey(conditionCheck.Key);
            }

            if (conditionCheck.ReturnValuesOnConditionCheckFailure != ReturnValuesOnConditionCheckFailure.None)
            {
                writer.WriteReturnValuesOnConditionCheckFailure(conditionCheck.ReturnValuesOnConditionCheckFailure);
            }

            writer.WriteEndObject();
        }