From c4743c18616678a450cc39a9aeaebc26fed0dea8 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Thu, 26 Mar 2026 15:56:41 +0100 Subject: [PATCH 1/7] =?UTF-8?q?feat=C2=A0:=20activer=20le=20d=C3=A9clenche?= =?UTF-8?q?ment=20manuel=20du=20flux=20de=20travail=20de=20d=C3=A9ploiemen?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index c58c5c7..4f45498 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -4,7 +4,7 @@ on: push: branches: - main - - dev + workflow_dispatch: jobs: # ───────────────────────────────────────────── From d65d21ea641a991fa8685b823469c0bad4297287 Mon Sep 17 00:00:00 2001 From: Loic Masi Date: Thu, 26 Mar 2026 18:48:41 +0100 Subject: [PATCH 2/7] #106 Ajout du mode Repositories Local --- Webzine.Entity/Fixtures/ArtisteFactory.cs | 15 -- Webzine.Entity/Fixtures/CommentaireFactory.cs | 22 +- Webzine.Entity/Fixtures/SeedDataLocal.cs | 141 ++++++++++- Webzine.Entity/Fixtures/StyleFactory.cs | 43 +--- Webzine.Entity/Fixtures/TitreFactory.cs | 46 ---- Webzine.Repository/DbEntityRepository.cs | 20 +- Webzine.Repository/InMemoryDataStore.cs | 15 ++ Webzine.Repository/LocalArtisteRepository.cs | 87 ++----- .../LocalCommentaireRepository.cs | 43 ++++ Webzine.Repository/LocalStyleRepository.cs | 96 +------- Webzine.Repository/LocalTitreRepository.cs | 219 ++---------------- Webzine.WebApplication/Program.cs | 46 +++- .../Views/Titre/Details.cshtml | 2 +- Webzine.WebApplication/appsettings.json | 2 +- 14 files changed, 302 insertions(+), 495 deletions(-) create mode 100644 Webzine.Repository/InMemoryDataStore.cs create mode 100644 Webzine.Repository/LocalCommentaireRepository.cs diff --git a/Webzine.Entity/Fixtures/ArtisteFactory.cs b/Webzine.Entity/Fixtures/ArtisteFactory.cs index 44f297a..d8ecb26 100644 --- a/Webzine.Entity/Fixtures/ArtisteFactory.cs +++ b/Webzine.Entity/Fixtures/ArtisteFactory.cs @@ -49,20 +49,5 @@ namespace Webzine.Entity.Fixtures return artisteFaker.Generate(); } - - /// - /// Permet de retourner une liste d'artiste pour seeder la base - /// de données. - /// - /// - /// Liste d'artiste. - public static List CreerListeArtiste(int nombre) - { - Faker faker = new Faker("fr") - .RuleFor(a => a.Nom, f => f.Person.FullName) - .RuleFor(a => a.Biographie, f => f.Lorem.Paragraph(2)); - - return faker.Generate(nombre); - } } } \ No newline at end of file diff --git a/Webzine.Entity/Fixtures/CommentaireFactory.cs b/Webzine.Entity/Fixtures/CommentaireFactory.cs index 790cfc2..c798b36 100644 --- a/Webzine.Entity/Fixtures/CommentaireFactory.cs +++ b/Webzine.Entity/Fixtures/CommentaireFactory.cs @@ -8,26 +8,6 @@ namespace Webzine.Entity.Fixtures { public class CommentaireFactory { - /// - /// Seeder pour la base de données. - /// - /// Titre. - /// Min. - /// Max. - /// Liste de commentaire. - public static List CreerListeCommentaire(Titre titre, int min = 0, int max = 5) - { - Random random = new Random(); - int count = random.Next(min, max + 1); - - Faker faker = new Faker("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); - } + } } diff --git a/Webzine.Entity/Fixtures/SeedDataLocal.cs b/Webzine.Entity/Fixtures/SeedDataLocal.cs index 544b730..9b69c5f 100644 --- a/Webzine.Entity/Fixtures/SeedDataLocal.cs +++ b/Webzine.Entity/Fixtures/SeedDataLocal.cs @@ -3,12 +3,151 @@ // namespace Webzine.Entity.Fixtures -{ +{ + using Bogus; public class SeedDataLocal { public SeedDataLocal() { } + + /// + /// Generer une liste d'artiste. + /// + /// Nombre d'artiste. + /// Liste d'artiste. + public static List GenererListeArtiste(int nombre) + { + Faker artistes = new Faker("fr") + .RuleFor(a => a.Nom, f => f.Person.FullName) + .RuleFor(a => a.Biographie, f => f.Lorem.Paragraph(2)); + + return artistes.Generate(nombre); + } + + /// + /// Generer une liste de titre. + /// + /// Nombre de titre à créer. + /// Liste d'artiste. + /// Liste de style. + /// Liste de titre. + public static List GenererListeTitre( + int count, + List artistes, + List