Esempio n. 1
0
        public ActionResult Delete(Person p)
        {
            PeopleViewModel m = new PeopleViewModel();

            try
            {
                var personToRemove = PeopleViewModel.people.Find(x => x.Name == p.Name);
                // TODO: Add delete logic here
                m.DeletePerson(personToRemove);
                //PeopleViewModel.people.Remove(personToRemove);
                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View("Index", m.GetAllPeople().ToList()));
            }
        }