Inheritance: ShopifyResourceModel, IFullMutable
Exemplo n.º 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();
            }
        }
Exemplo n.º 2
0
        public async Task<ActionResult> Delete(Product condemned)
        {
            await _shopify.GetResource<Product>().Delete<Product>(condemned);

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

            return RedirectToAction("Index");
        }