From 4deb7af6f058901539e4efe55f4e785429cf8984 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Thu, 26 Mar 2026 11:13:52 +0100 Subject: [PATCH] =?UTF-8?q?refactor:=20remplacer=20Invocation=20du=20compo?= =?UTF-8?q?sant=20Sidebar=20par=20une=20vue=20partielle=20et=20mettre=20?= =?UTF-8?q?=C3=A0=20jour=20la=20liste=20des=20styles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Sidebar/Default.cs | 21 -------- .../Views/Shared/_Layout.cshtml | 2 +- .../Views/Shared/_Sidebar.cshtml | 50 +++++++++++++++---- 3 files changed, 41 insertions(+), 32 deletions(-) delete mode 100644 Webzine.WebApplication/Components/Sidebar/Default.cs diff --git a/Webzine.WebApplication/Components/Sidebar/Default.cs b/Webzine.WebApplication/Components/Sidebar/Default.cs deleted file mode 100644 index c9f1be5..0000000 --- a/Webzine.WebApplication/Components/Sidebar/Default.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Webzine.Repository.Contracts; - -namespace Webzine.Components -{ - public class SidebarViewComponent : ViewComponent - { - private readonly IStyleRepository styleRepository; - - public SidebarViewComponent(IStyleRepository styleRepository) - { - this.styleRepository = styleRepository; - } - - public IViewComponentResult Invoke() - { - var styles = this.styleRepository.FindAll(); - return this.View(styles); - } - } -} \ No newline at end of file diff --git a/Webzine.WebApplication/Views/Shared/_Layout.cshtml b/Webzine.WebApplication/Views/Shared/_Layout.cshtml index e330c9d..234b357 100644 --- a/Webzine.WebApplication/Views/Shared/_Layout.cshtml +++ b/Webzine.WebApplication/Views/Shared/_Layout.cshtml @@ -19,7 +19,7 @@ @if(ViewContext.RouteData.Values["area"]?.ToString() != "Administration") { - @await Component.InvokeAsync("Sidebar") + } diff --git a/Webzine.WebApplication/Views/Shared/_Sidebar.cshtml b/Webzine.WebApplication/Views/Shared/_Sidebar.cshtml index 2a48b2e..49dedf2 100644 --- a/Webzine.WebApplication/Views/Shared/_Sidebar.cshtml +++ b/Webzine.WebApplication/Views/Shared/_Sidebar.cshtml @@ -1,5 +1,8 @@ -@model IEnumerable - +@* + For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 +*@ +@{ +}