Merge branch 'dev' into j3/TODO_erreurs
This commit is contained in:
@@ -168,5 +168,37 @@ namespace Webzine.Repository
|
||||
throw new Exception("Erreur lors de la recherche d'artiste {error}", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public int Count()
|
||||
{
|
||||
try
|
||||
{
|
||||
int count = Enumerable.Count(this.context.Artistes);
|
||||
this.logger.LogDebug("Nombre total d'artistes dans la base: {Count}", count);
|
||||
return count;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.logger.LogError(ex, "Erreur lors du comptage des artistes.");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public int Count(Func<Artiste, bool> predicate)
|
||||
{
|
||||
try
|
||||
{
|
||||
int count = this.context.Artistes.Count(predicate);
|
||||
this.logger.LogDebug("Nombre d'artistes (avec prédicat): {Count}", count);
|
||||
return count;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.logger.LogError(ex, "Erreur lors du comptage des artistes avec prédicat.");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user