diff --git a/Sources/DataManagers/ChampChanger.cs b/Sources/DataManagers/ChampChanger.cs index 916c90f..6f9d3f4 100644 --- a/Sources/DataManagers/ChampChanger.cs +++ b/Sources/DataManagers/ChampChanger.cs @@ -8,16 +8,16 @@ namespace DataManagers { public static Champion ToPoco(this ChampionEntity champion) { - return new Champion(name: champion.Name, champClass: champion.ChampClass, icon: champion.Icon, bio: champion.Bio); + return new Champion(id: champion.Id, name: champion.Name, champClass: champion.ChampClass, icon: champion.Icon, bio: champion.Bio); } public static ChampionEntity ToEntity(this Champion champion) => new ChampionEntity { + Id = champion.Id, Name = champion.Name, Bio = champion.Bio, Icon = champion.Icon, ChampClass = champion.Class, - //Characteristics = champion.Characteristics.Select(dict => dict).ToDictionary(pair => pair.Key, pair => pair.Value) }; public static IEnumerable ToPocos(this IEnumerable champs) diff --git a/Sources/EFLib/oiseaux.db-shm b/Sources/EFLib/oiseaux.db-shm new file mode 100644 index 0000000..fe9ac28 Binary files /dev/null and b/Sources/EFLib/oiseaux.db-shm differ diff --git a/Sources/EFLib/oiseaux.db-wal b/Sources/EFLib/oiseaux.db-wal new file mode 100644 index 0000000..e69de29 diff --git a/Sources/Model/Champion.cs b/Sources/Model/Champion.cs index 3a50658..7fb808c 100644 --- a/Sources/Model/Champion.cs +++ b/Sources/Model/Champion.cs @@ -6,6 +6,17 @@ using System.Text; namespace Model; public class Champion : IEquatable { + + public int Id + { + get => id; + private init + { + id = value; + } + } + private readonly int id; + public string Name { get => name; @@ -42,6 +53,18 @@ public class Champion : IEquatable public LargeImage Image { get; set; } + public Champion(int id, string name, ChampionClass champClass = ChampionClass.Unknown, string icon = "", string image = "", string bio = "") + { + Id = id; + Name = name; + Class = champClass; + Icon = icon; + Image = new LargeImage(image); + Bio = bio; + Characteristics = new ReadOnlyDictionary(characteristics); + Skins = new ReadOnlyCollection(skins); + } + public Champion(string name, ChampionClass champClass = ChampionClass.Unknown, string icon = "", string image = "", string bio = "") { Name = name;