push bdd (v2 tjr pas dico ni skill)

rune
Louison PARANT 2 years ago
parent 12b0acc1a9
commit b5d8d82ad7

@ -1,13 +0,0 @@
using EntityFrameworkLOL.Entities;
using Microsoft.EntityFrameworkCore;
namespace EntityFrameworkLOL.DBContexts
{
class ChampionContext : DbContext
{
public DbSet<ChampionEntity> Champion { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder options)
=> options.UseSqlite($"Data Source=DBLOL.db");
}
}

@ -1,13 +0,0 @@
using EntityFrameworkLOL.Entities;
using Microsoft.EntityFrameworkCore;
namespace EntityFrameworkLOL.DBContexts
{
class RuneContext : DbContext
{
public DbSet<RuneEntity> Rune { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder options)
=> options.UseSqlite($"Data Source=DBLOL.db");
}
}

@ -1,13 +0,0 @@
using EntityFrameworkLOL.Entities;
using Microsoft.EntityFrameworkCore;
namespace EntityFrameworkLOL.DBContexts
{
class SkinContext : DbContext
{
public DbSet<SkinEntity> Skin { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder options)
=> options.UseSqlite($"Data Source=DBLOL.db");
}
}

@ -26,6 +26,7 @@ namespace EntityFrameworkLOL.Entities
[NotMapped]
public Dictionary<string, int> Characteristics { get; set; }
// Switch Dictionary to List puis faudra juste mapper la liste en dico
public ChampionClassEntity Class { get; set; }

@ -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)
{

Loading…
Cancel
Save