Fix. Ajout de LodDegub au lieu de LogInformation. Ajout de this. aux redirections de vues.

This commit is contained in:
josephine.vetu
2026-03-27 10:46:31 +01:00
parent ff9355765b
commit 528d1b0d16
2 changed files with 8 additions and 8 deletions

View File

@@ -63,7 +63,7 @@ namespace Webzine.Repository
this.context.Artistes.Remove(artiste); this.context.Artistes.Remove(artiste);
this.context.SaveChanges(); this.context.SaveChanges();
this.logger.LogInformation("L'artiste {IdArtiste} a bien été supprimé", artiste.IdArtiste); this.logger.LogDebug("L'artiste {IdArtiste} a bien été supprimé", artiste.IdArtiste);
} }
catch (DbUpdateException dbex) catch (DbUpdateException dbex)
{ {
@@ -125,7 +125,7 @@ namespace Webzine.Repository
{ {
// .AsNoTracking() rend la requête beaucoup plus rapide pour de la lecture // .AsNoTracking() rend la requête beaucoup plus rapide pour de la lecture
var artistes = this.context.Artistes.AsNoTracking().ToList(); var artistes = this.context.Artistes.AsNoTracking().ToList();
this.logger.LogInformation("{Count} artistes récupérés de la base.", artistes.Count); this.logger.LogDebug("{Count} artistes récupérés de la base.", artistes.Count);
return artistes; return artistes;
} }
catch (Exception ex) catch (Exception ex)
@@ -147,7 +147,7 @@ namespace Webzine.Repository
{ {
this.context.Artistes.Update(artiste); this.context.Artistes.Update(artiste);
this.context.SaveChanges(); this.context.SaveChanges();
this.logger.LogInformation("Artiste {Id} ({Nom}) mis à jour avec succès.", artiste.IdArtiste, artiste.Nom); this.logger.LogDebug("Artiste {Id} ({Nom}) mis à jour avec succès.", artiste.IdArtiste, artiste.Nom);
} }
catch (DbUpdateException ex) catch (DbUpdateException ex)
{ {

View File

@@ -39,7 +39,7 @@ public class ArtisteController : Controller
var artistes_ordre = artistes.OrderBy(t => t.Nom).ToList(); var artistes_ordre = artistes.OrderBy(t => t.Nom).ToList();
return View(artistes_ordre); return this.View(artistes_ordre);
} }
/// <summary> /// <summary>
@@ -55,7 +55,7 @@ public class ArtisteController : Controller
Biographie = string.Empty, Biographie = string.Empty,
}; };
return View(model); return this.View(model);
} }
/// <summary> /// <summary>
@@ -74,14 +74,14 @@ public class ArtisteController : Controller
Biographie = artiste.Biographie, Biographie = artiste.Biographie,
}; };
return View(model); return this.View(model);
} }
/// <summary> /// <summary>
/// Renvoie à la page supprimer un artiste. /// Renvoie à la page supprimer un artiste.
/// </summary> /// </summary>
/// <param name="id">L'identifiant de l'artiste à supprimer. </param> /// <param name="id">L'identifiant de l'artiste à supprimer. </param>
/// <returns>Redirection.></returns> /// <returns>Redirection.</returns>
public IActionResult Delete(int id) public IActionResult Delete(int id)
{ {
var artiste = this.artisteRepository.Find(id); var artiste = this.artisteRepository.Find(id);
@@ -91,7 +91,7 @@ public class ArtisteController : Controller
Nom = artiste.Nom, Nom = artiste.Nom,
Biographie = artiste.Biographie, Biographie = artiste.Biographie,
}; };
return View(model); return this.View(model);
} }
/// <summary> /// <summary>