#154 : Première optimisation de la recherche
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user