Пример #1
0
 public IActionResult Delete(int id)
 {
     try
     {
         _authorManager.DeleteAuthor(id);
         return(Ok());
     }
     catch (ArgumentException ex)
     {
         return(BadRequest(ex));
     }
 }
        public IActionResult Delete(Guid id, string password)
        {
            var author = authorManager.GetAuthor(id);

            if (author == null)
            {
                return(NotFound());
            }
            if (!authorManager.VerifyAuthor(author.Name, password))
            {
                return(Unauthorized());
            }

            authorManager.DeleteAuthor(author);
            return(Ok());
        }
 public ActionResult Delete(string id, Author author) //dummy is to change c# singature. it will get a null value
 {
     authorManager.DeleteAuthor(id);
     return(RedirectToAction("List"));
 }