From 8c404922e9c73c91f2c559ea133bf0eab70201fc Mon Sep 17 00:00:00 2001 From: "arthur.valin" Date: Wed, 1 Feb 2023 17:34:45 +0100 Subject: [PATCH] Inserting mock data --- .../EntityFramework.Champions.db-wal | Bin 0 -> 8272 bytes .../EntityFramework/EntityFramework.csproj | 5 +++++ .../Sources/EntityFramework/Program.cs | 19 ++++++++++++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/EntityFramework_LoL/Sources/EntityFramework/EntityFramework.Champions.db-wal b/EntityFramework_LoL/Sources/EntityFramework/EntityFramework.Champions.db-wal index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..e531c0b22fb2d5d8718ab75acfdc7b9921fb8bef 100644 GIT binary patch literal 8272 zcmeI$Eepa>6vpv8oQi@tkb&{qECazHSbYOg24b*Y^#);E7|dW1?1JCN&tMg^Rm7;# zyCC=#l>fsy^Pivdo3GZ4J!Vzg2etX|@g66z7>5P-MXDa)3;qNnW=v~xzAD2lvepA%n$?+KmY**5I_I{1Q0*~0R#~EGl6`@Eu?>gH?qSg AT>t<8 literal 0 HcmV?d00001 diff --git a/EntityFramework_LoL/Sources/EntityFramework/EntityFramework.csproj b/EntityFramework_LoL/Sources/EntityFramework/EntityFramework.csproj index b6dee0a..06df015 100644 --- a/EntityFramework_LoL/Sources/EntityFramework/EntityFramework.csproj +++ b/EntityFramework_LoL/Sources/EntityFramework/EntityFramework.csproj @@ -5,6 +5,7 @@ net6.0 enable enable + $(MSBuildProjectDirectory) @@ -22,4 +23,8 @@ + + + + diff --git a/EntityFramework_LoL/Sources/EntityFramework/Program.cs b/EntityFramework_LoL/Sources/EntityFramework/Program.cs index 3751555..8772279 100644 --- a/EntityFramework_LoL/Sources/EntityFramework/Program.cs +++ b/EntityFramework_LoL/Sources/EntityFramework/Program.cs @@ -1,2 +1,17 @@ -// See https://aka.ms/new-console-template for more information -Console.WriteLine("Hello, World!"); +using EntityFramework.DbContexts; +using EntityFramework.Entities; +using Model; + +ChampionEntity dave = new ChampionEntity() +{ + Name = "Dave", + Bio = "Le meilleur Jazzman de France", + Icon = "aaa" +}; +using (var context = new ChampionDbContext()) +{ + // Crée des nounours et les insère dans la base + Console.WriteLine("Creates and inserts new Champion"); + context.Add(dave); + context.SaveChanges(); +}