#106 Ajout du mode Repositories Local

This commit is contained in:
Loic Masi
2026-03-26 18:48:41 +01:00
parent c95f77b6e6
commit d65d21ea64
14 changed files with 302 additions and 495 deletions

View File

@@ -8,26 +8,6 @@ namespace Webzine.Entity.Fixtures
{
public class CommentaireFactory
{
/// <summary>
/// Seeder pour la base de données.
/// </summary>
/// <param name="titre">Titre.</param>
/// <param name="min">Min.</param>
/// <param name="max">Max.</param>
/// <returns>Liste de commentaire.</returns>
public static List<Commentaire> CreerListeCommentaire(Titre titre, int min = 0, int max = 5)
{
Random random = new Random();
int count = random.Next(min, max + 1);
Faker<Commentaire> faker = new Faker<Commentaire>("fr")
.RuleFor(c => c.Auteur, f => f.Internet.UserName())
.RuleFor(c => c.Contenu, f => f.Lorem.Sentences(2))
.RuleFor(c => c.DateCreation, f => f.Date.Recent(60))
.RuleFor(c => c.Titre, _ => titre)
.RuleFor(c => c.IdTitre, _ => titre.IdTitre);
return faker.Generate(count);
}
}
}