Many to Many and the dictionaries done 🐵
continuous-integration/drone/push Build is passing Details

UT_EF_Manager
Emre KARTAL 2 years ago
parent b1ac2fccd3
commit 30542716df

@ -15,7 +15,6 @@ namespace MyFlib
var image1 = new LargeImageEntity { Id = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}"), Base64 = "empty" };
// Champions
ChampionEntity hecarim = new ChampionEntity { Name = "Hecarim", Class = ChampionClassEntity.Assassin, Bio = "", Icon = "", ImageId = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}") };
ChampionEntity nasus = new ChampionEntity { Name = "Nasus", Class = ChampionClassEntity.Tank, Bio = "", Icon = "", ImageId = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}") };
ChampionEntity ashe = new ChampionEntity { Name = "Ashe", Class = ChampionClassEntity.Marksman, Bio = "", Icon = "", ImageId = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}") };
@ -23,21 +22,19 @@ namespace MyFlib
context.AddRange(hecarim, nasus, ashe);
// Skins
SkinEntity darkJhin = new SkinEntity { Name = "Dark Cosmic Jhin", ChampionForeignKey = Guid.Parse("{234F5E7F-F196-4C88-AD1C-6C392AA2E038}"), Description = "In the depths of the universe, serial killer Jhin has found a new form of power in cosmic darkness. With his galaxy mask and strange synergy with the four elements of space, he's never been deadlier.", Icon = "empty", Price = 1820, ImageId = Guid.Parse("{7cc1b02d-29a3-4493-96b7-1e3d9f3e14e2}") };
SkinEntity kaiSaPrestige = new SkinEntity { Name = "K/DA Kai'Sa Prestige Edition", ChampionForeignKey = Guid.Parse("{15E0C4F4-4C04-4CCE-8F4D-78F37F63E63F}"), Description = "Kai'Sa, the hottest K-pop star of the moment, knows that to make a sensation, you have to be willing to do anything. With her dazzling outfit and electrifying dance moves, she'll make waves on stage and on the battlefield.", Icon = "empty", Price = 2000, ImageId = Guid.Parse("{555c9eb9-f41f-42f1-a05b-ae5d2ee7f782}") };
SkinEntity pykeProject = new SkinEntity { Name = "PROJECT: Pyke", ChampionForeignKey = Guid.Parse("{F32FA768-A1DC-4F6A-9366-FFEC6B0D4159}"), Description = "Pyke, the ultimate android assassin, has recently been upgraded to carry out the most complex missions. With his new tools and enhanced programming, he can sneak into any security system and eliminate any target.", Icon = "empty", Price = 1350, ImageId = Guid.Parse("{6b47024c-0c1d-4066-bda8-2cb0d7c900fa}") };
SkinEntity darkJhin = new SkinEntity { Name = "Dark Cosmic Jhin", ChampionForeignKey = hecarim.Id, Description = "In the depths of the universe, serial killer Jhin has found a new form of power in cosmic darkness. With his galaxy mask and strange synergy with the four elements of space, he's never been deadlier.", Icon = "empty", Price = 1820, ImageId = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}") };
SkinEntity kaiSaPrestige = new SkinEntity { Name = "K/DA Kai'Sa Prestige Edition", ChampionForeignKey = nasus.Id, Description = "Kai'Sa, the hottest K-pop star of the moment, knows that to make a sensation, you have to be willing to do anything. With her dazzling outfit and electrifying dance moves, she'll make waves on stage and on the battlefield.", Icon = "empty", Price = 2000, ImageId = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}") };
SkinEntity pykeProject = new SkinEntity { Name = "PROJECT: Pyke", ChampionForeignKey = ashe.Id, Description = "Pyke, the ultimate android assassin, has recently been upgraded to carry out the most complex missions. With his new tools and enhanced programming, he can sneak into any security system and eliminate any target.", Icon = "empty", Price = 1350, ImageId = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}") };
context.AddRange(darkJhin, kaiSaPrestige, pykeProject);
// Skills
SkillEntity yasuoTempest = new SkillEntity { Name = "Yasuo's Steel Tempest", Description = " une attaque de mêlée qui peut être chargée pour infliger des dégâts supplémentaires et projeter les ennemis dans les airs.", Type = SkillTypeEntity.Basic };
SkillEntity LuxFinal = new SkillEntity { Name = "Lux's Final Spark", Description = "une attaque à distance qui inflige des dégâts massifs dans une direction.", Type = SkillTypeEntity.Ultimate };
SkillEntity yasuoTempest = new SkillEntity { Name = "Yasuo's Steel Tempest", Description = " une attaque de mêlée qui peut être chargée pour infliger des dégâts supplémentaires et projeter les ennemis dans les airs.", Type = SkillTypeEntity.Basic, ChampionForeignKey = hecarim.Id };
SkillEntity LuxFinal = new SkillEntity { Name = "Lux's Final Spark", Description = "une attaque à distance qui inflige des dégâts massifs dans une direction.", Type = SkillTypeEntity.Ultimate, ChampionForeignKey = ashe.Id };
context.AddRange(yasuoTempest, LuxFinal);
// Runes
RuneEntity conqueror = new RuneEntity { Name = "Conqueror", Description = "by dealing damage to an enemy champion, you accumulate stacks that, once fully stacked, increase your damage and provide you with healing.", Family = RuneFamilyEntity.Unknown, ImageId = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}") };
RuneEntity ravenousHunter = new RuneEntity { Name = "Ravenous Hunter", Description = "killing minions, monsters, or enemy champions grants you stacks of Ravenous Hunter, which increase your damage against enemy champions and provide you with healing.", Family = RuneFamilyEntity.Domination, ImageId = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}") };

@ -1,4 +1,5 @@
using System;
using MyFlib.Entities;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@ -14,7 +15,7 @@ namespace MyFlib
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid Id { get; set; }
[Required]
[MaxLength(64)]
[MaxLength(64, ErrorMessage = "the champion name must not exceed 64 characters")]
public string Name { get; set; }
[Required]
[MaxLength(255)]
@ -22,9 +23,10 @@ namespace MyFlib
public string Icon { get; set; }
[Required]
public ChampionClassEntity Class { get; set; }
public ICollection<SkillEntity> Skills { get; set; }
public ICollection<SkinEntity> Skins { get; set; }
public ICollection<SkillEntity> Skills { get; set; } = new List<SkillEntity>();
public ICollection<SkinEntity> Skins { get; set; } = new List<SkinEntity>();
public ICollection<CharacteristicEntity> Characteristics { get; set; }
public ICollection<RunePageEntity> RunePages { get; set; } = new List<RunePageEntity>();
public LargeImageEntity Image { get; set; }
[ForeignKey("Image")]

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MyFlib.Entities
{
public class CharacteristicEntity
{
[Key]
[MaxLength(254)]
public string Name { get; set; }
[Required]
public int Value { get; set; }
[Required]
public Guid ChampionForeignKey { get; set; }
[ForeignKey("ChampionForeignKey")]
public ChampionEntity Champion { get; set; }
}
}

@ -0,0 +1,25 @@
using MyFlib.Entities;
using MyFlib.Entities.enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MyFlib
{
public class DictionaryCategoryRune
{
public CategoryEntity category { get; set; }
[ForeignKey("RunePageName")]
public RunePageEntity runePage { get; set; }
public string RunePageName { get; set; }
[ForeignKey("RuneName")]
public RuneEntity rune { get; set; }
public string RuneName { get; set; }
}
}

@ -12,7 +12,7 @@ namespace MyFlib
public class RuneEntity
{
[Key]
[MaxLength(64)]
[MaxLength(64, ErrorMessage = "the Rune name must not exceed 64 characters")]
public string Name { get; set; }
[Required]
@ -20,6 +20,7 @@ namespace MyFlib
public string Description { get; set; }
[Required]
public RuneFamilyEntity Family { get; set; }
public ICollection<DictionaryCategoryRune> DictionaryCategoryRunes { get; set; }
public LargeImageEntity Image { get; set; }
[ForeignKey("Image")]

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@ -8,5 +9,13 @@ namespace MyFlib.Entities
{
public class RunePageEntity
{
[Key]
[MaxLength(64, ErrorMessage = "the RunePage name must not exceed 64 characters")]
public string Name { get; set; }
public ICollection<ChampionEntity> Champions { get; set; }
public ICollection<DictionaryCategoryRune> DictionaryCategoryRunes { get; set; }
}
}

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@ -10,7 +11,7 @@ namespace MyFlib
public class SkillEntity
{
[Key]
[MaxLength(64)]
[MaxLength(64, ErrorMessage = "the Skill name must not exceed 64 characters")]
public string Name { get; set; }
[Required]
@ -20,5 +21,10 @@ namespace MyFlib
[Required]
public SkillTypeEntity Type { get; set; }
[Required]
[ForeignKey("ChampionForeignKey")]
public ChampionEntity Champion { get; set; }
public Guid ChampionForeignKey { get; set; }
}
}

@ -11,15 +11,17 @@ namespace MyFlib
public class SkinEntity
{
[Key]
[MaxLength(256)]
[MaxLength(254, ErrorMessage = "the Skin name must not exceed 254 characters")]
public string Name { get; set; }
[Required]
[MaxLength(500)]
[MaxLength(1000)]
public string Description { get; set; }
[Required]
public string Icon { get; set; }
[Required]
public float Price { get; set; }
[Required]
[ForeignKey("ChampionForeignKey")]
public ChampionEntity Champion { get; set; }
public Guid ChampionForeignKey { get; set; }
public LargeImageEntity Image { get; set; }

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace MyFlib.Entities.enums
{
enum CategoryEntity
public enum CategoryEntity
{
Major,
Minor1,

@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
using MyFlib.Entities;
using MyFlib.Entities.enums;
using System;
using System.Collections.Generic;
@ -15,6 +16,9 @@ namespace MyFlib
public DbSet<SkillEntity> Skills { get; set; }
public DbSet<SkinEntity> Skins { get; set; }
public DbSet<RuneEntity> Runes { get; set; }
public DbSet<DictionaryCategoryRune> CategoryRunes { get; set; }
public DbSet<RunePageEntity> RunePages { get; set; }
public LolDbContext()
{ }
@ -38,9 +42,9 @@ namespace MyFlib
//ChampionEntity
modelBuilder.Entity<ChampionEntity>().HasKey(e => e.Id);
modelBuilder.Entity<ChampionEntity>().Property(e => e.Id).ValueGeneratedOnAdd();
modelBuilder.Entity<ChampionEntity>().HasMany(champion => champion.RunePages).WithMany(runePage => runePage.Champions);
ChampionEntity Akali = new ChampionEntity { Id = Guid.Parse("{4422C524-B2CB-43EF-8263-990C3CEA7CAE}"), Name = "Akali", Class = ChampionClassEntity.Assassin, Bio = "", Icon = "", ImageId = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}") };
ChampionEntity Aatrox = new ChampionEntity { Id = Guid.Parse("{A4F84D92-C20F-4F2D-B3F9-CA00EF556E72}"), Name = "Aatrox", Class = ChampionClassEntity.Fighter, Bio = "", Icon = "", ImageId = Guid.Parse("{9f9086f5-5cc5-47b5-af9b-a935f4e9b89c}") };
ChampionEntity Ahri = new ChampionEntity { Id = Guid.Parse("{AE5FE535-F041-445E-B570-28B75BC78CB9}"), Name = "Ahri", Class = ChampionClassEntity.Mage, Bio = "", Icon = "", ImageId = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}") };
@ -52,9 +56,14 @@ namespace MyFlib
modelBuilder.Entity<ChampionEntity>().HasData(Akali, Aatrox, Ahri, Akshan, Bard, Alistar);
//SkillEntity
modelBuilder.Entity<SkillEntity>()
.HasOne(m => m.Champion)
.WithMany(a => a.Skills)
.HasForeignKey("ChampionForeignKey");
modelBuilder.Entity<SkillEntity>().HasData(
new { Name = "Boule de feu", Description = "Fire!", Type = SkillTypeEntity.Basic },
new { Name = "White Star", Description = "Random damage", Type = SkillTypeEntity.Ultimate }
new { Name = "Boule de feu", Description = "Fire!", Type = SkillTypeEntity.Basic, ChampionForeignKey = Guid.Parse("{4422C524-B2CB-43EF-8263-990C3CEA7CAE}") },
new { Name = "White Star", Description = "Random damage", Type = SkillTypeEntity.Ultimate, ChampionForeignKey = Guid.Parse("{3708dcfd-02a1-491e-b4f7-e75bf274cf23}") }
);
//SkinEntity
@ -69,9 +78,63 @@ namespace MyFlib
);
//RuneEntity
modelBuilder.Entity<RuneEntity>().HasData(
new RuneEntity { Name = "Hextech Flashtraption ", Description = "While Flash is on cooldown, it is replaced by Hexflash.", Family = RuneFamilyEntity.Unknown, ImageId = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}") },
new RuneEntity { Name = "Manaflow Band ", Description = "Hitting enemy champions with a spell grants 25 maximum mana, up to 250 mana.", Family = RuneFamilyEntity.Domination, ImageId = Guid.Parse("{9f9086f5-5cc5-47b5-af9b-a935f4e9b89c}") }
RuneEntity runeHextech = new RuneEntity { Name = "Hextech Flashtraption ", Description = "While Flash is on cooldown, it is replaced by Hexflash.", Family = RuneFamilyEntity.Unknown, ImageId = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}") };
RuneEntity runeManaflow = new RuneEntity { Name = "Manaflow Band ", Description = "Hitting enemy champions with a spell grants 25 maximum mana, up to 250 mana.", Family = RuneFamilyEntity.Domination, ImageId = Guid.Parse("{9f9086f5-5cc5-47b5-af9b-a935f4e9b89c}") };
modelBuilder.Entity<RuneEntity>().HasData(runeHextech, runeManaflow);
//RunePageEntity
RunePageEntity page1 = new RunePageEntity { Name = "Page 1" };
RunePageEntity page2 = new RunePageEntity { Name = "Page 2" };
modelBuilder.Entity<RunePageEntity>().HasData(page1, page2);
//DictionaryCategoryRune
modelBuilder.Entity<DictionaryCategoryRune>().HasKey(dictionary => new { dictionary.RunePageName, dictionary.RuneName });
modelBuilder.Entity<DictionaryCategoryRune>().HasData(
new DictionaryCategoryRune { category = CategoryEntity.Major, RuneName = runeHextech.Name, RunePageName = page1.Name },
new DictionaryCategoryRune { category = CategoryEntity.Minor1, RuneName = runeManaflow.Name, RunePageName = page1.Name },
new DictionaryCategoryRune { category = CategoryEntity.OtherMinor1, RuneName = runeManaflow.Name, RunePageName = page2.Name },
new DictionaryCategoryRune { category = CategoryEntity.OtherMinor2, RuneName = runeHextech.Name, RunePageName = page2.Name }
);
//CharacteristicEntity
modelBuilder.Entity<CharacteristicEntity>().HasKey(c => new { c.Name, c.ChampionForeignKey });
modelBuilder.Entity<CharacteristicEntity>().HasData(
new CharacteristicEntity { Name = "Attack Damage", Value = 58, ChampionForeignKey = Ahri.Id },
new CharacteristicEntity { Name = "Ability Power", Value = 92, ChampionForeignKey = Ahri.Id },
new CharacteristicEntity { Name = "Attack Speed", Value = 6, ChampionForeignKey = Ahri.Id },
new CharacteristicEntity { Name = "Health", Value = 526, ChampionForeignKey = Ahri.Id },
new CharacteristicEntity { Name = "Mana", Value = 418, ChampionForeignKey = Ahri.Id },
new CharacteristicEntity { Name = "Attack Damage", Value = 68, ChampionForeignKey = Akshan.Id },
new CharacteristicEntity { Name = "Ability Power", Value = 0, ChampionForeignKey = Akshan.Id },
new CharacteristicEntity { Name = "Attack Speed", Value = 1, ChampionForeignKey = Akshan.Id },
new CharacteristicEntity { Name = "Health", Value = 570, ChampionForeignKey = Akshan.Id },
new CharacteristicEntity { Name = "Mana", Value = 350, ChampionForeignKey = Akshan.Id },
new CharacteristicEntity { Name = "Attack Damage", Value = 70, ChampionForeignKey = Aatrox.Id },
new CharacteristicEntity { Name = "Ability Power", Value = 0, ChampionForeignKey = Aatrox.Id },
new CharacteristicEntity { Name = "Attack Speed", Value = 1, ChampionForeignKey = Aatrox.Id },
new CharacteristicEntity { Name = "Health", Value = 580, ChampionForeignKey = Aatrox.Id },
new CharacteristicEntity { Name = "Mana", Value = 0, ChampionForeignKey = Aatrox.Id },
new CharacteristicEntity { Name = "Attack Damage", Value = 56, ChampionForeignKey = Akali.Id },
new CharacteristicEntity { Name = "Ability Power", Value = 0, ChampionForeignKey = Akali.Id },
new CharacteristicEntity { Name = "Attack Speed", Value = 1, ChampionForeignKey = Akali.Id },
new CharacteristicEntity { Name = "Health", Value = 575, ChampionForeignKey = Akali.Id },
new CharacteristicEntity { Name = "Mana", Value = 200, ChampionForeignKey = Akali.Id },
new CharacteristicEntity { Name = "Attack Damage", Value = 63, ChampionForeignKey = Alistar.Id },
new CharacteristicEntity { Name = "Ability Power", Value = 0, ChampionForeignKey = Alistar.Id },
new CharacteristicEntity { Name = "Attack Speed", Value = 2, ChampionForeignKey = Alistar.Id },
new CharacteristicEntity { Name = "Health", Value = 573, ChampionForeignKey = Alistar.Id },
new CharacteristicEntity { Name = "Mana", Value = 278, ChampionForeignKey = Alistar.Id },
new CharacteristicEntity { Name = "Ability Power", Value = 30, ChampionForeignKey = Bard.Id },
new CharacteristicEntity { Name = "Attack Speed", Value = 1, ChampionForeignKey = Bard.Id },
new CharacteristicEntity { Name = "Health", Value = 535, ChampionForeignKey = Bard.Id },
new CharacteristicEntity { Name = "Mana", Value = 350, ChampionForeignKey = Bard.Id }
);
}

@ -5,7 +5,7 @@ using static System.Console;
using (var context = new LolDbContext())
{
WriteLine("\nChampions :\n");
WriteLine("Champions :\n");
foreach (var c in context.Champions)
{
@ -18,10 +18,6 @@ using (var context = new LolDbContext())
foreach (var c in context.Champions)
{
WriteLine($"{c.Name} - {c.Class}");
/* foreach (var s in c.Skills)
{
WriteLine($"\t\t{s.Name} - {s.Description}");
}*/
}
WriteLine("\nSkills :\n");
@ -38,7 +34,5 @@ using (var context = new LolDbContext())
WriteLine($"{c.Name} - {c.Description} - Price: {c.Price} - ChampionId: {c.ChampionForeignKey}");
}
WriteLine("\nRunes :\n");
context.SaveChangesAsync(); // or context.SaveChangesAsync
}

@ -19,10 +19,10 @@ namespace UT_EF
using (var context = new LolDbContext(options))
{
SkillEntity fireBall = new SkillEntity { Name = "Boule de feu", Description = "Fire!", Type = SkillTypeEntity.Basic };
SkillEntity whiteStar = new SkillEntity { Name = "White Star", Description = "Random damage", Type = SkillTypeEntity.Ultimate };
SkillEntity yasuoTempest = new SkillEntity { Name = "Yasuo's Steel Tempest", Description = " une attaque de mêlée qui peut être chargée pour infliger des dégâts supplémentaires et projeter les ennemis dans les airs.", Type = SkillTypeEntity.Basic };
SkillEntity LuxFinal = new SkillEntity { Name = "Lux's Final Spark", Description = "une attaque à distance qui inflige des dégâts massifs dans une direction.", Type = SkillTypeEntity.Ultimate };
SkillEntity fireBall = new SkillEntity { Name = "Boule de feu", Description = "Fire!", Type = SkillTypeEntity.Basic, ChampionForeignKey = Guid.Parse("{234F5E7F-F196-4C88-AD1C-6C392AA2E038}") };
SkillEntity whiteStar = new SkillEntity { Name = "White Star", Description = "Random damage", Type = SkillTypeEntity.Ultimate, ChampionForeignKey = Guid.Parse("{15E0C4F4-4C04-4CCE-8F4D-78F37F63E63F}") };
SkillEntity yasuoTempest = new SkillEntity { Name = "Yasuo's Steel Tempest", Description = " une attaque de mêlée qui peut être chargée pour infliger des dégâts supplémentaires et projeter les ennemis dans les airs.", Type = SkillTypeEntity.Basic, ChampionForeignKey = Guid.Parse("{F32FA768-A1DC-4F6A-9366-FFEC6B0D4159}") };
SkillEntity LuxFinal = new SkillEntity { Name = "Lux's Final Spark", Description = "une attaque à distance qui inflige des dégâts massifs dans une direction.", Type = SkillTypeEntity.Ultimate, ChampionForeignKey = Guid.Parse("{F32FA768-A1DC-4F6A-9366-FFEC6B0D4159}") };
context.Skills.AddRange(fireBall, whiteStar, yasuoTempest, LuxFinal);
context.SaveChanges();
@ -44,10 +44,10 @@ namespace UT_EF
using (var context = new LolDbContext(options))
{
SkillEntity fireBall = new SkillEntity { Name = "Boule de feu", Description = "Fire!", Type = SkillTypeEntity.Unknown };
SkillEntity whiteStar = new SkillEntity { Name = "White Star", Description = "Random damage", Type = SkillTypeEntity.Ultimate };
SkillEntity yasuoTempest = new SkillEntity { Name = "Yasuo's Steel Tempest", Description = " une attaque de mêlée qui peut être chargée pour infliger des dégâts supplémentaires et projeter les ennemis dans les airs.", Type = SkillTypeEntity.Basic };
SkillEntity LuxFinal = new SkillEntity { Name = "Lux's Final Spark", Description = "une attaque à distance qui inflige des dégâts massifs dans une direction.", Type = SkillTypeEntity.Ultimate };
SkillEntity fireBall = new SkillEntity { Name = "Boule de feu", Description = "Fire!", Type = SkillTypeEntity.Basic, ChampionForeignKey = Guid.Parse("{234F5E7F-F196-4C88-AD1C-6C392AA2E038}") };
SkillEntity whiteStar = new SkillEntity { Name = "White Star", Description = "Random damage", Type = SkillTypeEntity.Ultimate, ChampionForeignKey = Guid.Parse("{15E0C4F4-4C04-4CCE-8F4D-78F37F63E63F}") };
SkillEntity yasuoTempest = new SkillEntity { Name = "Yasuo's Steel Tempest", Description = " une attaque de mêlée qui peut être chargée pour infliger des dégâts supplémentaires et projeter les ennemis dans les airs.", Type = SkillTypeEntity.Basic, ChampionForeignKey = Guid.Parse("{F32FA768-A1DC-4F6A-9366-FFEC6B0D4159}") };
SkillEntity LuxFinal = new SkillEntity { Name = "Lux's Final Spark", Description = "une attaque à distance qui inflige des dégâts massifs dans une direction.", Type = SkillTypeEntity.Ultimate, ChampionForeignKey = Guid.Parse("{F32FA768-A1DC-4F6A-9366-FFEC6B0D4159}") };
context.Skills.AddRange(fireBall, whiteStar, yasuoTempest, LuxFinal);
context.SaveChanges();
@ -87,10 +87,10 @@ namespace UT_EF
using (var context = new LolDbContext(options))
{
SkillEntity fireBall = new SkillEntity { Name = "Boule de feu", Description = "Fire!", Type = SkillTypeEntity.Basic };
SkillEntity whiteStar = new SkillEntity { Name = "White Star", Description = "Random damage", Type = SkillTypeEntity.Ultimate };
SkillEntity yasuoTempest = new SkillEntity { Name = "Yasuo's Steel Tempest", Description = " une attaque de mêlée qui peut être chargée pour infliger des dégâts supplémentaires et projeter les ennemis dans les airs.", Type = SkillTypeEntity.Basic };
SkillEntity LuxFinal = new SkillEntity { Name = "Lux's Final Spark", Description = "une attaque à distance qui inflige des dégâts massifs dans une direction.", Type = SkillTypeEntity.Ultimate };
SkillEntity fireBall = new SkillEntity { Name = "Boule de feu", Description = "Fire!", Type = SkillTypeEntity.Basic, ChampionForeignKey = Guid.Parse("{234F5E7F-F196-4C88-AD1C-6C392AA2E038}") };
SkillEntity whiteStar = new SkillEntity { Name = "White Star", Description = "Random damage", Type = SkillTypeEntity.Ultimate, ChampionForeignKey = Guid.Parse("{15E0C4F4-4C04-4CCE-8F4D-78F37F63E63F}") };
SkillEntity yasuoTempest = new SkillEntity { Name = "Yasuo's Steel Tempest", Description = " une attaque de mêlée qui peut être chargée pour infliger des dégâts supplémentaires et projeter les ennemis dans les airs.", Type = SkillTypeEntity.Basic, ChampionForeignKey = Guid.Parse("{F32FA768-A1DC-4F6A-9366-FFEC6B0D4159}") };
SkillEntity LuxFinal = new SkillEntity { Name = "Lux's Final Spark", Description = "une attaque à distance qui inflige des dégâts massifs dans une direction.", Type = SkillTypeEntity.Ultimate, ChampionForeignKey = Guid.Parse("{F32FA768-A1DC-4F6A-9366-FFEC6B0D4159}") };
context.Skills.AddRange(fireBall, whiteStar, yasuoTempest, LuxFinal);
context.SaveChanges();

Loading…
Cancel
Save