Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            var mailMessageToDelete = mymodel.GetById(id);

            try
            {
                if (ModelState.IsValid)
                {
                    if (!mymodel.Delete(mailMessageToDelete))
                    {
                        throw new Exception();
                    }
                }

                return(RedirectToAction("Index"));
            }
            catch (Exception)
            {
                return(HttpNotFound());
            }
        }