|
|
@ -1,6 +1,6 @@
|
|
|
|
using EFLol;
|
|
|
|
using EFLol;
|
|
|
|
|
|
|
|
|
|
|
|
ChampionEntity Zeus = new ChampionEntity
|
|
|
|
/*ChampionEntity Zeus = new ChampionEntity
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Name = "Zeus",
|
|
|
|
Name = "Zeus",
|
|
|
|
Bio = "Zeus is the king of the gods."
|
|
|
|
Bio = "Zeus is the king of the gods."
|
|
|
@ -11,8 +11,27 @@ using (var context = new ChampionContext())
|
|
|
|
Console.WriteLine("Adding Zeus to the database...");
|
|
|
|
Console.WriteLine("Adding Zeus to the database...");
|
|
|
|
context.Champions.Add(Zeus);
|
|
|
|
context.Champions.Add(Zeus);
|
|
|
|
context.SaveChanges();
|
|
|
|
context.SaveChanges();
|
|
|
|
}
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ChampionEntity chewie = new ChampionEntity { Name = "Chewbacca", Bio = "Zeus is the king of the gods." };
|
|
|
|
|
|
|
|
ChampionEntity yoda = new ChampionEntity { Name = "Yoda", Bio = "Zeus is the king of the gods." };
|
|
|
|
|
|
|
|
ChampionEntity ewok = new ChampionEntity { Name = "Ewok" , Bio = "Zeus is the king of the gods." };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using (var context = new ChampionContext())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// Crée des nounours et les insère dans la base
|
|
|
|
|
|
|
|
Console.WriteLine("Creates and inserts new Nounours");
|
|
|
|
|
|
|
|
context.Add(chewie);
|
|
|
|
|
|
|
|
context.Add(yoda);
|
|
|
|
|
|
|
|
context.Add(ewok);
|
|
|
|
|
|
|
|
context.SaveChanges();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using (var context = new ChampionContext())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var n in context.Champions)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Console.WriteLine($"{n.Id} - {n.Name}");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
context.SaveChanges();
|
|
|
|
|
|
|
|
}
|