Merge pull request 'j2/fix/commentaire' (#91) from j2/fix/commentaire into TODO_erreurs
Reviewed-on: http://10.4.0.131/gitea/DI1-P4-E1/Webzine/pulls/91 Reviewed-by: j.vetu <josephine.vetu@diiage.org>
This commit is contained in:
@@ -41,39 +41,11 @@ namespace Webzine.WebApplication.Areas.Administration.Controllers
|
||||
public IActionResult Index()
|
||||
{
|
||||
// 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
|
||||
var viewModel = new CommentaireViewModel
|
||||
{
|
||||
Commentaires = listeCommentaires
|
||||
Commentaires = _commentaires
|
||||
};
|
||||
|
||||
return View(viewModel);
|
||||
|
||||
Reference in New Issue
Block a user