diff --git a/Webzine.WebApplication/Areas/Admin/Views/Commentaires/Index.cshtml b/Webzine.WebApplication/Areas/Admin/Views/Commentaires/Index.cshtml
new file mode 100644
index 0000000..0199999
--- /dev/null
+++ b/Webzine.WebApplication/Areas/Admin/Views/Commentaires/Index.cshtml
@@ -0,0 +1,90 @@
+@using Webzine.WebApplication.ViewModels
+@using Webzine.Entity
+@model CommentaireViewModel
+
+@{
+ ViewData["Title"] = "Commentaires";
+ Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
+}
+
+
+
+
Commentaires
+
+
diff --git a/Webzine.WebApplication/Areas/Admin/Views/Shared/_Layout.cshtml b/Webzine.WebApplication/Areas/Admin/Views/Shared/_Layout.cshtml
new file mode 100644
index 0000000..559941b
--- /dev/null
+++ b/Webzine.WebApplication/Areas/Admin/Views/Shared/_Layout.cshtml
@@ -0,0 +1,181 @@
+
+
+
+
+
+ @ViewData["Title"] - Administration
+
+
+
+
+
+
+
+
+ @RenderBody()
+
+
+
+
\ No newline at end of file
diff --git a/Webzine.WebApplication/Controllers/CommentairesController.cs b/Webzine.WebApplication/Controllers/CommentairesController.cs
new file mode 100644
index 0000000..9c60b25
--- /dev/null
+++ b/Webzine.WebApplication/Controllers/CommentairesController.cs
@@ -0,0 +1,113 @@
+using System;
+using System.Collections.Generic;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Webzine.Entity;
+using Webzine.WebApplication.ViewModels;
+
+namespace Webzine.WebApplication.Controllers
+{
+ [Area("Admin")]
+ public class CommentairesController : Controller
+ {
+ // GET: Admin/Commentaires
+ public ActionResult Index()
+ {
+ // Création de données "bouchon" (mock) pour tester l'affichage
+ var listeCommentaires = new List
+ {
+ 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
+ };
+
+ return View(viewModel);
+ }
+
+
+
+ // GET: CommentairesController/Details/5
+ public ActionResult Details(int id)
+ {
+ return View();
+ }
+
+ // GET: CommentairesController/Create
+ public ActionResult Create()
+ {
+ return View();
+ }
+
+ // POST: CommentairesController/Create
+ [HttpPost]
+ [ValidateAntiForgeryToken]
+ public ActionResult Create(IFormCollection collection)
+ {
+ try
+ {
+ return RedirectToAction(nameof(Index));
+ }
+ catch
+ {
+ return View();
+ }
+ }
+
+ // GET: CommentairesController/Edit/5
+ public ActionResult Edit(int id)
+ {
+ return View();
+ }
+
+ // POST: CommentairesController/Edit/5
+ [HttpPost]
+ [ValidateAntiForgeryToken]
+ public ActionResult Edit(int id, IFormCollection collection)
+ {
+ try
+ {
+ return RedirectToAction(nameof(Index));
+ }
+ catch
+ {
+ return View();
+ }
+ }
+
+ // GET: CommentairesController/Delete/5
+ public ActionResult Delete(int id)
+ {
+ return View();
+ }
+
+ // POST: CommentairesController/Delete/5
+ }
+}
\ No newline at end of file
diff --git a/Webzine.WebApplication/Program.cs b/Webzine.WebApplication/Program.cs
index 575f1cf..c9ca7ea 100644
--- a/Webzine.WebApplication/Program.cs
+++ b/Webzine.WebApplication/Program.cs
@@ -30,6 +30,12 @@ try
// Active le middleware permettant le routage des requ�tes entrantes.
app.UseRouting();
+
+ // Ajoute une route pour les zones (Areas) comme Admin
+ app.MapControllerRoute(
+ name: "areas",
+ pattern: "{area:exists}/{controller=Home}/{action=Index}/{id?}");
+
// Ajoute un endpoint permettant de router les urls
// avec la forme /controller/action/id(optionnel).
// Equivalent � app.MapDefaultControllerRoute()
diff --git a/Webzine.WebApplication/ViewModels/CommentaireViewModel.cs b/Webzine.WebApplication/ViewModels/CommentaireViewModel.cs
new file mode 100644
index 0000000..cbd09da
--- /dev/null
+++ b/Webzine.WebApplication/ViewModels/CommentaireViewModel.cs
@@ -0,0 +1,19 @@
+//
+// Copyright (c) Webzine. All rights reserved.
+//
+
+using Webzine.Entity;
+
+namespace Webzine.WebApplication.ViewModels
+{
+ ///
+ /// ViewModel pour afficher la liste des commentaires en administration.
+ ///
+ public class CommentaireViewModel
+ {
+ ///
+ /// Obtient ou définit la liste des commentaires.
+ ///
+ public IEnumerable Commentaires { get; set; } = new List();
+ }
+}
\ No newline at end of file
diff --git a/Webzine.WebApplication/Webzine.WebApplication.csproj b/Webzine.WebApplication/Webzine.WebApplication.csproj
index 5651896..4f72671 100644
--- a/Webzine.WebApplication/Webzine.WebApplication.csproj
+++ b/Webzine.WebApplication/Webzine.WebApplication.csproj
@@ -17,6 +17,7 @@
+
@@ -25,12 +26,16 @@
-
-
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+