public IActionResult Delete(int id) { try { Commentaire commentaire = _commentaireRepository.Find(id); CommentairesViewModel vm = new CommentairesViewModel { Auteur = commentaire.Auteur, DateCreation = commentaire.DateCreation, IdCommentaire = commentaire.IdCommentaire, NomTitre = commentaire.Titre.Libelle, NomArtiste = commentaire.Titre.Artiste.Nom }; return(this.View(nameof(CommentairesController.Delete), vm)); } catch (NullReferenceException e) { return(RedirectToAction(nameof(CommentairesController.Index), "Commentaires", new { area = "Administration" })); } }
public IViewComponentResult Invoke(CommentairesViewModel comment) { return(View(comment)); }