public async Task <IActionResult> DeleteConfirmed(int id) { var autor = _context.GetEntityById(id); await _context.Delete(autor); return(RedirectToAction(nameof(Index))); }
public ActionResult Delete(int id, AutorViewModel autorViewModel) { try { _autorApp.Delete(autorViewModel); return(RedirectToAction(nameof(Index))); } catch { return(View(autorViewModel)); } }
public async Task <ActionResult <Autor> > DeleteAutor(int id) { var autor = _context.GetEntityById(id); if (autor == null) { return(NotFound()); } await _context.Delete(autor); return(autor); }
public void Delete(int id) { var autorViewModel = _autorApp.Read(id); _autorApp.Delete(autorViewModel); }