コード例 #1
0
 public ActionResult Delete(string id, FormCollection collection)
 {
     try
     {
         productos.borrarProducto(id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
コード例 #2
0
        public async Task <ActionResult> Delete(string id, IFormCollection collection)
        {
            try
            {
                // TODO: Add delete logic here
                await productos.borrarProducto(id);

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(View());
            }
        }