You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1022 B

using EFLol;
/*ChampionEntity Zeus = new ChampionEntity
{
Name = "Zeus",
Bio = "Zeus is the king of the gods."
};
using (var context = new ChampionContext())
{
Console.WriteLine("Adding Zeus to the database...");
context.Champions.Add(Zeus);
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();
}