refactor: standardiser la journalisation des contrôleurs et l’utilisation des référentiels

This commit is contained in:
mirage
2026-03-25 15:14:14 +01:00
parent adeb2a0550
commit cceff9a02d
18 changed files with 214 additions and 252 deletions

View File

@@ -180,7 +180,7 @@ public class DbTitreRepository : ITitreRepository
/// </summary>
/// <param name="idTitre">L'identifiant du titre à trouver.</param>
/// <returns>Le titre correspondant à l'identifiant fourni, ou null si aucun titre n'est trouvé.</returns>
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;
}