Inheritance: ShopifyResourceModel, IFullMutable
Example #1
0
        public async Task<ActionResult> Create(FormCollection collection)
        {
            try
            {
                var newProduct = new Product()
                {
                    Title = collection["Title"]
                };

                await _shopify.GetResource<Product>().Save<Product>(newProduct);

                return RedirectToAction("Index");
            }
            catch (Exception)
            {
                // handle the exception
                return View();
            }
        }
Example #2
0
        public async Task<ActionResult> Delete(Product condemned)
        {
            await _shopify.GetResource<Product>().Delete<Product>(condemned);

            return RedirectToAction("Index");
        }
Example #3
0
        public async Task<ActionResult> Edit(Product data)
        {
            await _shopify.GetResource<Product>().Update<Product>(data);

            return RedirectToAction("Index");
        }