#154 : Première optimisation de la recherche

This commit is contained in:
Loic Masi
2026-03-31 13:06:30 +02:00
parent c65c0113af
commit 6f009fcc3d
6 changed files with 72 additions and 100 deletions

View File

@@ -120,7 +120,7 @@ namespace Webzine.Repository
try
{
// .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().Include(t => t.Titres).ToList();
this.logger.LogDebug("{Count} artistes récupérés de la base.", artistes.Count);
return artistes;
}

View File

@@ -242,6 +242,7 @@ public class DbTitreRepository : ITitreRepository
.Include(t => t.Styles)
.Where(t => t.Libelle.ToLower().Contains(mot.ToLower()))
.OrderBy(t => t.Libelle)
.AsNoTracking()
.ToList();
this.logger.LogDebug("{Count} titres trouvés correspondant à '{Mot}'", titres.Count, mot);