From b5d8d82ad7fcdbb4a87d4dfaa80412de2b0fe20f Mon Sep 17 00:00:00 2001 From: Louison PARANT Date: Wed, 8 Feb 2023 17:25:08 +0100 Subject: [PATCH] push bdd (v2 tjr pas dico ni skill) --- .../DBContexts/ChampionContext.cs | 13 ------------- .../EntityFrameworkLOL/DBContexts/RuneContext.cs | 13 ------------- .../EntityFrameworkLOL/DBContexts/SkinContext.cs | 13 ------------- .../EntityFrameworkLOL/Entities/ChampionEntity.cs | 1 + Sources/EntityFrameworkLOL/Program.cs | 8 ++++---- 5 files changed, 5 insertions(+), 43 deletions(-) delete mode 100644 Sources/EntityFrameworkLOL/DBContexts/ChampionContext.cs delete mode 100644 Sources/EntityFrameworkLOL/DBContexts/RuneContext.cs delete mode 100644 Sources/EntityFrameworkLOL/DBContexts/SkinContext.cs diff --git a/Sources/EntityFrameworkLOL/DBContexts/ChampionContext.cs b/Sources/EntityFrameworkLOL/DBContexts/ChampionContext.cs deleted file mode 100644 index f7d3a11..0000000 --- a/Sources/EntityFrameworkLOL/DBContexts/ChampionContext.cs +++ /dev/null @@ -1,13 +0,0 @@ -using EntityFrameworkLOL.Entities; -using Microsoft.EntityFrameworkCore; - -namespace EntityFrameworkLOL.DBContexts -{ - class ChampionContext : DbContext - { - public DbSet Champion { get; set; } - - protected override void OnConfiguring(DbContextOptionsBuilder options) - => options.UseSqlite($"Data Source=DBLOL.db"); - } -} \ No newline at end of file diff --git a/Sources/EntityFrameworkLOL/DBContexts/RuneContext.cs b/Sources/EntityFrameworkLOL/DBContexts/RuneContext.cs deleted file mode 100644 index daa69f9..0000000 --- a/Sources/EntityFrameworkLOL/DBContexts/RuneContext.cs +++ /dev/null @@ -1,13 +0,0 @@ -using EntityFrameworkLOL.Entities; -using Microsoft.EntityFrameworkCore; - -namespace EntityFrameworkLOL.DBContexts -{ - class RuneContext : DbContext - { - public DbSet Rune { get; set; } - - protected override void OnConfiguring(DbContextOptionsBuilder options) - => options.UseSqlite($"Data Source=DBLOL.db"); - } -} \ No newline at end of file diff --git a/Sources/EntityFrameworkLOL/DBContexts/SkinContext.cs b/Sources/EntityFrameworkLOL/DBContexts/SkinContext.cs deleted file mode 100644 index 5628c53..0000000 --- a/Sources/EntityFrameworkLOL/DBContexts/SkinContext.cs +++ /dev/null @@ -1,13 +0,0 @@ -using EntityFrameworkLOL.Entities; -using Microsoft.EntityFrameworkCore; - -namespace EntityFrameworkLOL.DBContexts -{ - class SkinContext : DbContext - { - public DbSet Skin { get; set; } - - protected override void OnConfiguring(DbContextOptionsBuilder options) - => options.UseSqlite($"Data Source=DBLOL.db"); - } -} \ No newline at end of file diff --git a/Sources/EntityFrameworkLOL/Entities/ChampionEntity.cs b/Sources/EntityFrameworkLOL/Entities/ChampionEntity.cs index dbf5173..bfd6593 100644 --- a/Sources/EntityFrameworkLOL/Entities/ChampionEntity.cs +++ b/Sources/EntityFrameworkLOL/Entities/ChampionEntity.cs @@ -26,6 +26,7 @@ namespace EntityFrameworkLOL.Entities [NotMapped] public Dictionary Characteristics { get; set; } + // Switch Dictionary to List puis faudra juste mapper la liste en dico public ChampionClassEntity Class { get; set; } diff --git a/Sources/EntityFrameworkLOL/Program.cs b/Sources/EntityFrameworkLOL/Program.cs index 3a99cee..be3799b 100644 --- a/Sources/EntityFrameworkLOL/Program.cs +++ b/Sources/EntityFrameworkLOL/Program.cs @@ -15,7 +15,7 @@ class Program ChampionEntity alistar = new ChampionEntity { Name = "Alistar", Bio = "" }; ChampionEntity akshan = new ChampionEntity { Name = "Akshan", Bio = "" }; - using (var context = new ChampionContext()) + using (var context = new SQLiteContext()) { // Crée des champions et les insère dans la base Console.WriteLine("Creates and inserts new Champions"); @@ -40,7 +40,7 @@ class Program RuneEntity laststand = new RuneEntity { Name = "Last Stand", Description = "" }; RuneEntity laststand2 = new RuneEntity { Name = "Last Stand 2", Description = "" }; - using (var context = new RuneContext()) + using (var context = new SQLiteContext()) { // Crée des Runes et les insère dans la base Console.WriteLine("Creates and inserts new Runes"); @@ -65,7 +65,7 @@ class Program SkinEntity mecha = new SkinEntity { Name = "Mecha", Description = "" }; SkinEntity seaHunter = new SkinEntity { Name = "Sea Hunter", Description = "" }; - using (var context = new SkinContext()) + using (var context = new SQLiteContext()) { // Crée des Skins et les insère dans la base Console.WriteLine("Creates and inserts new Skins"); @@ -94,7 +94,7 @@ class Program context.SaveChanges(); } - using (var context = new ChampionContext()) + using (var context = new SQLiteContext()) { foreach (var c in context.Champion) {