|
|
|
@ -1,11 +1,15 @@
|
|
|
|
|
using DTO;
|
|
|
|
|
using Model;
|
|
|
|
|
using static System.Net.Mime.MediaTypeNames;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace EntityFramwork.Factories
|
|
|
|
|
{
|
|
|
|
|
public class Factories
|
|
|
|
|
public static class Factories
|
|
|
|
|
{
|
|
|
|
|
public EntityChampions ChampionModelToEntity(Champion champ)
|
|
|
|
|
|
|
|
|
|
// Factorie Champion
|
|
|
|
|
public static EntityChampions ChampionModelToEntity(this Champion champ)
|
|
|
|
|
{
|
|
|
|
|
EntityChampions entity = new EntityChampions();
|
|
|
|
|
|
|
|
|
@ -17,7 +21,42 @@ namespace EntityFramwork.Factories
|
|
|
|
|
return entity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public EntitySkins SkinsModelToEntity(Skin skin,int id)
|
|
|
|
|
public static Champion EntityChampionToModele(this EntityChampions entity)
|
|
|
|
|
{
|
|
|
|
|
ChampionClass classe = ChampionClass.Unknown;
|
|
|
|
|
|
|
|
|
|
switch (entity.Classe)
|
|
|
|
|
{
|
|
|
|
|
case "Assassin":
|
|
|
|
|
classe = ChampionClass.Assassin;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "Fighter":
|
|
|
|
|
classe = ChampionClass.Fighter;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "Mage":
|
|
|
|
|
classe = ChampionClass.Mage;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "Support":
|
|
|
|
|
classe = ChampionClass.Support;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "Tank":
|
|
|
|
|
classe = ChampionClass.Tank;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Attention l'image !!
|
|
|
|
|
return new Champion(entity.Name,champClass:classe,icon:entity.Icon,bio:entity.Bio);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Skins
|
|
|
|
|
public static EntitySkins SkinsModelToEntity(this Skin skin,int id)
|
|
|
|
|
{
|
|
|
|
|
EntitySkins entity= new EntitySkins();
|
|
|
|
|
|
|
|
|
@ -31,7 +70,7 @@ namespace EntityFramwork.Factories
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public EntityRunes RuneModelToEntity(Rune rune)
|
|
|
|
|
public static EntityRunes RuneModelToEntity(this Rune rune)
|
|
|
|
|
{
|
|
|
|
|
EntityRunes entity = new EntityRunes();
|
|
|
|
|
|
|
|
|
@ -43,7 +82,7 @@ namespace EntityFramwork.Factories
|
|
|
|
|
return entity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public EntitySkill SkillModeleToEntity(Skill skill,int championId)
|
|
|
|
|
public static EntitySkill SkillModeleToEntity(this Skill skill,int championId)
|
|
|
|
|
{
|
|
|
|
|
EntitySkill entity = new EntitySkill();
|
|
|
|
|
|
|
|
|
|