Exemplo n.º 1
0
        public ActionResult <object> DeleteCharacter(int id)
        {
            var character = _chars.GetById(id);

            if (character == null)
            {
                return(NotFound());
            }

            _chars.Delete(character);

            return(Ok(
                       new { Message = "Deleted successfully!" }
                       ));
        }
Exemplo n.º 2
0
 public IActionResult RemoveCharacter(CharacterViewModel cvm)
 {
     _cr.Delete(cvm.Id);
     return(RedirectToAction("Characters"));
 }