From 4c1dbe4cef1fa2b0127f404861048dc52a24e231 Mon Sep 17 00:00:00 2001 From: nathan boileau Date: Wed, 1 Feb 2023 16:34:43 +0100 Subject: [PATCH] Classe champion et champion contexte --- Sources/EFLol/Champion.cs | 2 ++ Sources/EFLol/ChampionContext.cs | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 Sources/EFLol/ChampionContext.cs diff --git a/Sources/EFLol/Champion.cs b/Sources/EFLol/Champion.cs index a71bd9f..c067647 100644 --- a/Sources/EFLol/Champion.cs +++ b/Sources/EFLol/Champion.cs @@ -8,5 +8,7 @@ namespace EFLol { internal class Champion { + public string Name { get; set; } + public string Bio { get; set; } } } diff --git a/Sources/EFLol/ChampionContext.cs b/Sources/EFLol/ChampionContext.cs new file mode 100644 index 0000000..fd63455 --- /dev/null +++ b/Sources/EFLol/ChampionContext.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; + +namespace EFLol +{ + internal class ChampionContext : DbContext + { + public DbSet Champions { get; set; } + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + optionsBuilder.UseSqlite("Data Source=Champions.db"); + } + } +}