public async Task <IActionResult> DeleteConfirmed(int id) { var objectToDelete = await _engines.GetEngineById(id, true); if (objectToDelete == null) { return(NotFound()); } _engines.Archive(objectToDelete); await _engines.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); }