diff --git a/Webzine.Repository.Contracts/IArtisteRepository.cs b/Webzine.Repository.Contracts/IArtisteRepository.cs index 1e4a369..2f112fc 100644 --- a/Webzine.Repository.Contracts/IArtisteRepository.cs +++ b/Webzine.Repository.Contracts/IArtisteRepository.cs @@ -1,17 +1,17 @@ -// using Webzine.Entity; +using Webzine.Entity; namespace Webzine.Repository.Contracts { public interface IArtisteRepository { - // void Add(Artiste artiste); + void Add(Artiste artiste); - // void Delete(Artiste artiste); + void Delete(Artiste artiste); - // Artiste Find(int id); + Artiste Find(int id); - // IEnumerable FindAll(); + IEnumerable FindAll(); - // void Update(Artiste artiste); + void Update(Artiste artiste); } } \ No newline at end of file diff --git a/Webzine.Repository.Contracts/ICommentaireRepository.cs b/Webzine.Repository.Contracts/ICommentaireRepository.cs index f1608b2..04fd1dd 100644 --- a/Webzine.Repository.Contracts/ICommentaireRepository.cs +++ b/Webzine.Repository.Contracts/ICommentaireRepository.cs @@ -1,15 +1,15 @@ -// using Webzine.Entity; +using Webzine.Entity; namespace Webzine.Repository.Contracts { public interface ICommentaireRepository { - // void Add(Commentaire commentaire); + void Add(Commentaire commentaire); - // void Delete(Commentaire commentaire); + void Delete(Commentaire commentaire); - // Commentaire Find(int id); + Commentaire Find(int id); - // IEnumerable FindAll(); + IEnumerable FindAll(); } } \ No newline at end of file diff --git a/Webzine.Repository.Contracts/IStyleRepository.cs b/Webzine.Repository.Contracts/IStyleRepository.cs index 6cc0e0b..ba078d9 100644 --- a/Webzine.Repository.Contracts/IStyleRepository.cs +++ b/Webzine.Repository.Contracts/IStyleRepository.cs @@ -1,5 +1,3 @@ -// using Webzine.Entity; - using Webzine.Entity; namespace Webzine.Repository.Contracts diff --git a/Webzine.Repository.Contracts/ITtitreRepository.cs b/Webzine.Repository.Contracts/ITtitreRepository.cs index 4dcd430..0031caa 100644 --- a/Webzine.Repository.Contracts/ITtitreRepository.cs +++ b/Webzine.Repository.Contracts/ITtitreRepository.cs @@ -10,7 +10,7 @@ namespace Webzine.Repository.Contracts void Delete(Titre titre); - Titre? Find(int idTitre); + Titre Find(int idTitre); IEnumerable FindTitres(int offset, int limit); diff --git a/Webzine.Repository/DbTitreRepository.cs b/Webzine.Repository/DbTitreRepository.cs index 54be151..221307e 100644 --- a/Webzine.Repository/DbTitreRepository.cs +++ b/Webzine.Repository/DbTitreRepository.cs @@ -180,7 +180,7 @@ public class DbTitreRepository : ITitreRepository /// /// L'identifiant du titre à trouver. /// Le titre correspondant à l'identifiant fourni, ou null si aucun titre n'est trouvé. - public Titre? Find(int idTitre) + public Titre Find(int idTitre) { this.logger.LogDebug($"Finding titre with Id: {idTitre}"); @@ -188,16 +188,7 @@ public class DbTitreRepository : ITitreRepository .Include(t => t.Artiste) .Include(t => t.Styles) .Include(t => t.Commentaires) - .FirstOrDefault(t => t.IdTitre == idTitre); - - if (titre == null) - { - this.logger.LogWarning($"Titre with Id {idTitre} not found"); - } - else - { - this.logger.LogDebug($"Found titre: {titre.Libelle}"); - } + .First(t => t.IdTitre == idTitre); return titre; } diff --git a/Webzine.WebApplication/Areas/Administration/Controllers/CommentaireController.cs b/Webzine.WebApplication/Areas/Administration/Controllers/CommentaireController.cs index 1342459..236bfb7 100644 --- a/Webzine.WebApplication/Areas/Administration/Controllers/CommentaireController.cs +++ b/Webzine.WebApplication/Areas/Administration/Controllers/CommentaireController.cs @@ -12,6 +12,7 @@ namespace Webzine.WebApplication.Areas.Administration.Controllers private readonly List _commentaires; /// + /// Initialise une nouvelle instance de la classe . /// Initialise une nouvelle instance du . /// Les données sont générées dynamiquement via . /// diff --git a/Webzine.WebApplication/Areas/Administration/Controllers/DashboardController.cs b/Webzine.WebApplication/Areas/Administration/Controllers/DashboardController.cs index a2ac740..7ef5253 100644 --- a/Webzine.WebApplication/Areas/Administration/Controllers/DashboardController.cs +++ b/Webzine.WebApplication/Areas/Administration/Controllers/DashboardController.cs @@ -1,6 +1,8 @@ +using System.Diagnostics; using Microsoft.AspNetCore.Mvc; using Webzine.Entity; using Webzine.Entity.Fixtures; +using Webzine.Repository.Contracts; using Webzine.WebApplication.Areas.Administration.ViewModels; namespace Webzine.WebApplication.Areas.Administration.Controllers; @@ -8,31 +10,24 @@ namespace Webzine.WebApplication.Areas.Administration.Controllers; [Area("Administration")] public class DashboardController : Controller { - private readonly ILogger _logger; - private readonly List _titres; - private readonly List