Merge branch 'TODO_erreurs' of http://10.4.0.131/gitea/DI1-P4-E1/Webzine into TODO_erreurs

This commit is contained in:
josephine.vetu
2026-03-25 10:48:01 +01:00

View File

@@ -41,39 +41,11 @@ namespace Webzine.WebApplication.Areas.Administration.Controllers
public IActionResult Index() public IActionResult Index()
{ {
// Création de données "bouchon" (mock) pour tester l'affichage // Création de données "bouchon" (mock) pour tester l'affichage
var listeCommentaires = new List<Commentaire>
{
new Commentaire
{
IdCommentaire = 1, // Correction: Id -> IdCommentaire
Auteur = "Michel", // Correction: Nom -> Auteur
Contenu = "Nulla sed velit nec tellus gravida molestie",
DateCreation = new DateTime(2023, 1, 22, 15, 59, 28),
// Important : On initialise l'objet Titre pour accéder à Titre.Libelle
Titre = new Titre { Libelle = "St Germain - So Flute" },
},
new Commentaire
{
IdCommentaire = 2,
Auteur = "Jeff",
Contenu = "Lorem ipsum dolor sit.",
DateCreation = new DateTime(2023, 1, 22, 14, 27, 8),
Titre = new Titre { Libelle = "Queen - Bohemian Rapsody" },
},
new Commentaire
{
IdCommentaire = 3,
Auteur = "Eva",
Contenu = "Aenean vulputate eleifend tellus.",
DateCreation = new DateTime(2023, 1, 22, 13, 2, 17),
Titre = new Titre { Libelle = "Rammstein - Du hast" },
},
};
// Initialisation du ViewModel // Initialisation du ViewModel
var viewModel = new CommentaireViewModel var viewModel = new CommentaireViewModel
{ {
Commentaires = listeCommentaires Commentaires = _commentaires
}; };
return View(viewModel); return View(viewModel);