Exemplo n.º 1
0
        public IActionResult Delete(int id)
        {
            var category = _context.Categories.Find(id);

            _context.Remove(category);
            _context.SaveChanges();
            return(RedirectToAction(nameof(Index)));
        }
Exemplo n.º 2
0
        public IActionResult Delete(int id)
        {
            var member = _context.Members.Find(id);

            if (member == null)
            {
                return(NotFound());
            }
            _context.Remove(member);
            _context.SaveChanges();
            return(RedirectToAction(nameof(Index)));
        }