Beispiel #1
0
        /// <summary>
        /// Updates the data for this subscription.
        /// </summary>
        /// <param name="updateData">The data to be submitted</param>
        public void Update(SubscriptionUpdate updateData)
        {
            if (updateData == null)
            {
                throw new ArgumentNullException("updateData");
            }

            var sb = new StringBuilder();

            XmlAttributeOverrides overrides = new XmlAttributeOverrides();
            XmlAttributes         attribs   = new XmlAttributes();

            attribs.XmlIgnore = true;
            if (!updateData.NoEndDate)
            {
                attribs.XmlElements.Add(new XmlElementAttribute("NoEndDate"));
                attribs.XmlElements.Add(new XmlElementAttribute("no-end-date"));
                overrides.Add(typeof(SubscriptionUpdate), "NoEndDate", attribs);
            }
            var serializer = new XmlSerializer(typeof(SubscriptionUpdate), overrides);

            serializer.Serialize(new StringWriter(sb), updateData);

            Client.Put("subscription/" + Reference, FastSpringClient.CleanUpXml(sb.ToString()));
        }
        /// <summary>
        /// Updates the data for this subscription.
        /// </summary>
        /// <param name="updateData">The data to be submitted</param>
        public void Update(SubscriptionUpdate updateData)
        {
            if (updateData == null)
            {
                throw new ArgumentNullException("updateData");
            }

            var sb = new StringBuilder();

            var serializer = new XmlSerializer(typeof(SubscriptionUpdate));

            serializer.Serialize(new StringWriter(sb), updateData);

            Client.Put("subscription/" + Reference, FastSpringClient.CleanUpXml(sb.ToString()));
        }