Exemplo n.º 1
0
        /// <summary>
        /// Create a Product Attribute
        /// </summary>
        /// <param name="productAttributeData">Product attribute to be created</param>
        /// <returns>Newly created product attribute object</returns>
        public async Task <ProductAttribute> Create(ProductAttribute productAttributeData)
        {
            var bundle = new ProductAttributeBundle {
                Content = productAttributeData
            };

            return((await Post(apiEndpoint: BaseApiEndpoint, toSerialize: bundle)).Content);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Update a product attribute
        /// </summary>
        /// <param name="productAttributeId">The identifier of product attribute</param>
        /// <param name="newData">The new data to be updated</param>
        /// <returns>New product attribute object</returns>
        public async Task <ProductAttribute> Update(int productAttributeId, ProductAttribute newData)
        {
            var endPoint = String.Format("{0}/{1}", BaseApiEndpoint, productAttributeId);
            var bundle   = new ProductAttributeBundle {
                Content = newData
            };

            return((await Put(endPoint, toSerialize: bundle)).Content);
        }