refactor: standardiser la journalisation des contrôleurs et l’utilisation des référentiels
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user