|
|
|
@ -8,6 +8,72 @@ class Program
|
|
|
|
|
{
|
|
|
|
|
static void Main(string[] args)
|
|
|
|
|
{
|
|
|
|
|
using (var context = new SQLiteContext()) {
|
|
|
|
|
if (context.Champion.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var c in context.Champion.ToArray())
|
|
|
|
|
{
|
|
|
|
|
context.Champion.Remove(c);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (context.Rune.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var r in context.Rune.ToArray())
|
|
|
|
|
{
|
|
|
|
|
context.Rune.Remove(r);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (context.Skin.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var s in context.Skin.ToArray())
|
|
|
|
|
{
|
|
|
|
|
context.Skin.Remove(s);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (context.Skill.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var s in context.Skill.ToArray())
|
|
|
|
|
{
|
|
|
|
|
context.Skill.Remove(s);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (context.RunePage.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var rp in context.RunePage.ToArray())
|
|
|
|
|
{
|
|
|
|
|
context.RunePage.Remove(rp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (context.ChampionClass.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var cc in context.ChampionClass.ToArray())
|
|
|
|
|
{
|
|
|
|
|
context.ChampionClass.Remove(cc);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (context.RuneFamily.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var rf in context.RuneFamily.ToArray())
|
|
|
|
|
{
|
|
|
|
|
context.RuneFamily.Remove(rf);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (context.SkillType.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var st in context.SkillType.ToArray())
|
|
|
|
|
{
|
|
|
|
|
context.SkillType.Remove(st);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (context.Image.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var i in context.Image.ToArray())
|
|
|
|
|
{
|
|
|
|
|
context.Image.Remove(i);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
context.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
ChampionEntity akali = new ChampionEntity { Name = "Akali", Bio = "" };
|
|
|
|
|
ChampionEntity aatrox = new ChampionEntity { Name = "Aatrox", Bio = "" };
|
|
|
|
|
ChampionEntity ahri = new ChampionEntity { Name = "Ahri", Bio = "" };
|
|
|
|
@ -19,12 +85,13 @@ class Program
|
|
|
|
|
{
|
|
|
|
|
// Crée des champions et les insère dans la base
|
|
|
|
|
Console.WriteLine("Creates and inserts new Champions");
|
|
|
|
|
context.Add(akali);
|
|
|
|
|
context.AddRange(new ChampionEntity[] { akali, aatrox, ahri, bard, alistar, akshan });
|
|
|
|
|
/*context.Add(akali);
|
|
|
|
|
context.Add(aatrox);
|
|
|
|
|
context.Add(ahri);
|
|
|
|
|
context.Add(bard);
|
|
|
|
|
context.Add(alistar);
|
|
|
|
|
context.Add(akshan);
|
|
|
|
|
context.Add(akshan);*/
|
|
|
|
|
context.SaveChanges();
|
|
|
|
|
Console.WriteLine("Creates and executes a query retrieving the first Champion of the database whose name starts with an \"A\":");
|
|
|
|
|
var aChampion = context.Champion
|
|
|
|
@ -44,12 +111,13 @@ class Program
|
|
|
|
|
{
|
|
|
|
|
// Crée des Runes et les insère dans la base
|
|
|
|
|
Console.WriteLine("Creates and inserts new Runes");
|
|
|
|
|
context.Add(conqueror);
|
|
|
|
|
context.AddRange(new RuneEntity[] { conqueror, thriumph, alacrity, tenacity, laststand, laststand2 });
|
|
|
|
|
/*context.Add(conqueror);
|
|
|
|
|
context.Add(thriumph);
|
|
|
|
|
context.Add(alacrity);
|
|
|
|
|
context.Add(tenacity);
|
|
|
|
|
context.Add(laststand);
|
|
|
|
|
context.Add(laststand2);
|
|
|
|
|
context.Add(laststand2);*/
|
|
|
|
|
context.SaveChanges();
|
|
|
|
|
Console.WriteLine("Creates and executes a query retrieving the first Runes of the database whose name starts with an \"L\":");
|
|
|
|
|
var lRune = context.Rune
|
|
|
|
@ -69,12 +137,13 @@ class Program
|
|
|
|
|
{
|
|
|
|
|
// Crée des Skins et les insère dans la base
|
|
|
|
|
Console.WriteLine("Creates and inserts new Skins");
|
|
|
|
|
context.Add(stinger);
|
|
|
|
|
context.AddRange(new SkinEntity[] { stinger, infernal, allStar, justicar, mecha, seaHunter });
|
|
|
|
|
/*context.Add(stinger);
|
|
|
|
|
context.Add(infernal);
|
|
|
|
|
context.Add(allStar);
|
|
|
|
|
context.Add(justicar);
|
|
|
|
|
context.Add(mecha);
|
|
|
|
|
context.Add(seaHunter);
|
|
|
|
|
context.Add(seaHunter);*/
|
|
|
|
|
context.SaveChanges();
|
|
|
|
|
Console.WriteLine("Creates and executes a query retrieving the first Skins of the database whose name starts with an \"I\":");
|
|
|
|
|
var iSkin = context.Skin
|
|
|
|
|