refactor: optimiser la logique de génération de commentaires dans SeedDataLocal et les fichiers associés
This commit is contained in:
@@ -59,7 +59,16 @@ namespace Webzine.Repository
|
||||
/// <inheritdoc/>
|
||||
public Artiste FindByName(string nom)
|
||||
{
|
||||
return this.dataStore.Artistes.First(a => a.Nom == nom);
|
||||
var artiste = this.dataStore.Artistes.FirstOrDefault(a => a.Nom == nom);
|
||||
|
||||
if (artiste != null)
|
||||
{
|
||||
artiste.Titres = this.dataStore.Titres
|
||||
.Where(t => t.IdArtiste == artiste.IdArtiste)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
return artiste;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
Reference in New Issue
Block a user