public IActionResult DeletePlayer(int PlayerId) { Player deletedPlayer = repository.DeletePlayer(PlayerId); if (deletedPlayer != null) { TempData["message"] = $"{deletedPlayer.PlayerName} was deleted"; } return(RedirectToAction("ClubDetailsViews", repository.Clubs.Where(c => c.ClubID == deletedPlayer.ClubID))); }
public IActionResult DeletePlayer(int playerId) { Player deletedPlayer = repository.DeletePlayer(playerId); if (deletedPlayer != null) { TempData["message"] = $"{deletedPlayer.PlayerName} was deleted successfully"; } return(RedirectToAction("ListPlayers")); }