Merge pull request 'ApiManager' (#11) from ApiManager into master
continuous-integration/drone/push Build is passing Details

Reviewed-on: #11
master
Emre KARTAL 2 years ago
commit de4a02bcc8

Binary file not shown.

@ -149,6 +149,14 @@ réalisez à nouveau la migration (ou mettez à jour celle actuelle), puis suppr
Si vous préférez éviter la manipulation de l'API, vous pouvez également utiliser le **client MAUI**. Celui-ci contacte directement l'ApiManager, qui se charge des requêtes HTTP à l'API, et vous permet de visualiser et de modifier les données grâce à une interface graphique. Si vous préférez éviter la manipulation de l'API, vous pouvez également utiliser le **client MAUI**. Celui-ci contacte directement l'ApiManager, qui se charge des requêtes HTTP à l'API, et vous permet de visualiser et de modifier les données grâce à une interface graphique.
Pour accomplir cela, veuillez configurer les propriétés de la solution en cliquant avec le bouton droit de la souris sur la solution, puis en sélectionnant "propriétés". De cette façon, vous pourrez lancer à la fois l'API et l'application League of Legends. Assurez-vous d'avoir les mêmes configurations :
<div align = center>
![HowToLaunch](doc/Images/HowToLaunch.png)
</div>
<u>Page **Home**:</u> <u>Page **Home**:</u>
<div align = center> <div align = center>

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

@ -17,6 +17,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ApiMapping\ApiMapping.csproj" />
<ProjectReference Include="..\DbManager\DbManager.csproj" /> <ProjectReference Include="..\DbManager\DbManager.csproj" />
<ProjectReference Include="..\DTO\DTO.csproj" /> <ProjectReference Include="..\DTO\DTO.csproj" />
<ProjectReference Include="..\Model\Model.csproj" /> <ProjectReference Include="..\Model\Model.csproj" />

@ -1,4 +1,4 @@
using ApiLol.Mapper; using ApiMapping;
using DTO; using DTO;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;

@ -1,4 +1,4 @@
using ApiLol.Mapper; using ApiMapping;
using DTO; using DTO;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;

@ -1,4 +1,4 @@
using ApiLol.Mapper; using ApiMapping;
using DTO; using DTO;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;

@ -1,4 +1,4 @@
using ApiLol.Mapper; using ApiMapping;
using DTO; using DTO;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;

@ -1,5 +1,4 @@
using ApiLol.Mapper; using ApiMapping;
using Azure.Core;
using DTO; using DTO;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;
@ -41,7 +40,7 @@ namespace ApiLol.Controllers.v2
return BadRequest($"Champion limit exceed, max {nbTotal}"); return BadRequest($"Champion limit exceed, max {nbTotal}");
} }
IEnumerable<ChampionDto> dtos = (await _manager.ChampionsMgr.GetItems(pageRequest.index, pageRequest.count)) IEnumerable<ChampionDto> dtos = (await _manager.ChampionsMgr.GetItems(pageRequest.index, pageRequest.count, pageRequest.orderingPropertyName, pageRequest.descending))
.Select(x => x.ToDto()); .Select(x => x.ToDto());
return Ok(dtos); return Ok(dtos);
} }
@ -81,7 +80,7 @@ namespace ApiLol.Controllers.v2
dtos = (await _manager.ChampionsMgr.GetItemsByName(pageRequest.name, pageRequest.index, pageRequest.count, pageRequest.orderingPropertyName, pageRequest.descending)) dtos = (await _manager.ChampionsMgr.GetItemsByName(pageRequest.name, pageRequest.index, pageRequest.count, pageRequest.orderingPropertyName, pageRequest.descending))
.Select(x => x.ToDto()); .Select(x => x.ToDto());
} }
return Ok(new PageResponse<ChampionDto>{ Data = dtos, index = pageRequest.index, count = pageRequest.count, total = nbTotal }); return Ok(new PageResponse<ChampionDto> { Data = dtos, index = pageRequest.index, count = pageRequest.count, total = nbTotal });
} }
catch (Exception error) catch (Exception error)
{ {

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\DTO\DTO.csproj" />
<ProjectReference Include="..\Model\Model.csproj" />
</ItemGroup>
</Project>

@ -1,40 +1,42 @@
using DTO; using ApiMapping;
using Model; using ApiMapping.enums;
using DTO;
namespace ApiLol.Mapper using Model;
{
public static class ChampionMapper namespace ApiMapping
{ {
public static ChampionDto ToDto(this Champion champion) public static class ChampionMapper
=> new() {
{ public static ChampionDto ToDto(this Champion champion)
Name = champion.Name, => new()
Bio = champion.Bio, {
Class = champion.Class.ToDto(), Name = champion.Name,
Icon = champion.Icon, Bio = champion.Bio,
Image = champion.Image.ToDto(), Class = champion.Class.ToDto(),
Skins = champion.Skins.Select(e => e.ToDto()), Icon = champion.Icon,
Skills = champion.Skills.Select(e => e.ToDto()), Image = champion.Image.ToDto(),
Characteristics = champion.Characteristics.ToDictionary(c => c.Key, c => c.Value) Skins = champion.Skins.Select(e => e.ToDto()),
Skills = champion.Skills.Select(e => e.ToDto()),
}; Characteristics = champion.Characteristics.ToDictionary(c => c.Key, c => c.Value)
};
public static Champion ToModel(this ChampionDto championDto)
{
var champ = new Champion(championDto.Name, championDto.Class.ToModel(), championDto.Icon, championDto.Image.Base64, championDto.Bio); public static Champion ToModel(this ChampionDto championDto)
foreach (var skin in championDto.Skins) {
{ var champ = new Champion(championDto.Name, championDto.Class.ToModel(), championDto.Icon, championDto.Image.Base64, championDto.Bio);
champ.AddSkin(skin.ToModel(champ)); foreach (var skin in championDto.Skins)
} {
foreach (var skill in championDto.Skills) champ.AddSkin(skin.ToModel(champ));
{ }
champ.AddSkill(skill.ToModel()); foreach (var skill in championDto.Skills)
} {
if (championDto.Characteristics != null) champ.AddSkill(skill.ToModel());
champ.AddCharacteristics(championDto.Characteristics.Select(c => Tuple.Create(c.Key, c.Value)).ToArray()); }
return champ; if (championDto.Characteristics != null)
} champ.AddCharacteristics(championDto.Characteristics.Select(c => Tuple.Create(c.Key, c.Value)).ToArray());
return champ;
} }
}
}
}

@ -1,7 +1,7 @@
using DTO; using DTO;
using Model; using Model;
namespace ApiLol.Mapper namespace ApiMapping
{ {
public static class LargeImageMapper public static class LargeImageMapper
{ {

@ -1,22 +1,23 @@
using ApiLol.Mapper.enums; using ApiMapping;
using DTO; using ApiMapping.enums;
using Model; using DTO;
using Model;
namespace ApiLol.Mapper
{ namespace ApiMapping
public static class RuneMapper {
{ public static class RuneMapper
public static RuneDto ToDto(this Rune rune) {
=> new() public static RuneDto ToDto(this Rune rune)
{ => new()
Name = rune.Name, {
Description = rune.Description, Name = rune.Name,
Family = rune.Family.ToDto(), Description = rune.Description,
Icon = rune.Icon, Family = rune.Family.ToDto(),
Image = rune.Image.ToDto() Icon = rune.Icon,
}; Image = rune.Image.ToDto()
};
public static Rune ToModel(this RuneDto rune) => new(rune.Name, rune.Family.ToModel(), rune.Icon, rune.Image.Base64, rune.Description);
public static Rune ToModel(this RuneDto rune) => new(rune.Name, rune.Family.ToModel(), rune.Icon, rune.Image.Base64, rune.Description);
}
} }
}

@ -1,9 +1,8 @@
using ApiLol.Mapper.enums; using DTO;
using DTO;
using Model; using Model;
using static Model.RunePage; using static Model.RunePage;
namespace ApiLol.Mapper namespace ApiMapping
{ {
public static class RunePageMapper public static class RunePageMapper
{ {

@ -1,19 +1,21 @@
using DTO; using ApiMapping;
using Model; using ApiMapping.enums;
using DTO;
namespace ApiLol.Mapper using Model;
{
public static class SkillMapper namespace ApiMapping
{ {
public static SkillDto ToDto(this Skill skill) public static class SkillMapper
=> new() {
{ public static SkillDto ToDto(this Skill skill)
Name = skill.Name, => new()
Description = skill.Description, {
Type = skill.Type.ToDto() Name = skill.Name,
}; Description = skill.Description,
Type = skill.Type.ToDto()
public static Skill ToModel(this SkillDto skillDto) => new(skillDto.Name, skillDto.Type.ToModel(), skillDto.Description); };
} public static Skill ToModel(this SkillDto skillDto) => new(skillDto.Name, skillDto.Type.ToModel(), skillDto.Description);
}
}
}

@ -1,7 +1,8 @@
using DTO; using ApiMapping;
using DTO;
using Model; using Model;
namespace ApiLol.Mapper namespace ApiMapping
{ {
public static class SkinMapper public static class SkinMapper
{ {

@ -1,7 +1,7 @@
using DTO; using DTO;
using Model; using Model;
namespace ApiLol.Mapper.enums namespace ApiMapping.enums
{ {
public static class CategoryMapper public static class CategoryMapper
{ {

@ -1,53 +1,53 @@
using DTO; using DTO;
using Model; using Model;
namespace ApiLol.Mapper namespace ApiMapping.enums
{ {
public static class ChampionClassMapper public static class ChampionClassMapper
{ {
public static ChampionClassDto ToDto(this ChampionClass championClass) public static ChampionClassDto ToDto(this ChampionClass championClass)
{ {
switch (championClass) switch (championClass)
{ {
case ChampionClass.Unknown: case ChampionClass.Unknown:
return ChampionClassDto.Unknown; return ChampionClassDto.Unknown;
case ChampionClass.Assassin: case ChampionClass.Assassin:
return ChampionClassDto.Assassin; return ChampionClassDto.Assassin;
case ChampionClass.Fighter: case ChampionClass.Fighter:
return ChampionClassDto.Fighter; return ChampionClassDto.Fighter;
case ChampionClass.Mage: case ChampionClass.Mage:
return ChampionClassDto.Mage; return ChampionClassDto.Mage;
case ChampionClass.Marksman: case ChampionClass.Marksman:
return ChampionClassDto.Marksman; return ChampionClassDto.Marksman;
case ChampionClass.Support: case ChampionClass.Support:
return ChampionClassDto.Support; return ChampionClassDto.Support;
case ChampionClass.Tank: case ChampionClass.Tank:
return ChampionClassDto.Tank; return ChampionClassDto.Tank;
default: default:
return ChampionClassDto.Unknown; return ChampionClassDto.Unknown;
} }
} }
public static ChampionClass ToModel(this ChampionClassDto championClass) public static ChampionClass ToModel(this ChampionClassDto championClass)
{ {
switch (championClass) switch (championClass)
{ {
case ChampionClassDto.Unknown: case ChampionClassDto.Unknown:
return ChampionClass.Unknown; return ChampionClass.Unknown;
case ChampionClassDto.Assassin: case ChampionClassDto.Assassin:
return ChampionClass.Assassin; return ChampionClass.Assassin;
case ChampionClassDto.Fighter: case ChampionClassDto.Fighter:
return ChampionClass.Fighter; return ChampionClass.Fighter;
case ChampionClassDto.Mage: case ChampionClassDto.Mage:
return ChampionClass.Mage; return ChampionClass.Mage;
case ChampionClassDto.Marksman: case ChampionClassDto.Marksman:
return ChampionClass.Marksman; return ChampionClass.Marksman;
case ChampionClassDto.Support: case ChampionClassDto.Support:
return ChampionClass.Support; return ChampionClass.Support;
case ChampionClassDto.Tank: case ChampionClassDto.Tank:
return ChampionClass.Tank; return ChampionClass.Tank;
default: default:
return ChampionClass.Unknown; return ChampionClass.Unknown;
} }
} }
} }
} }

@ -2,7 +2,7 @@
using DTO.enums; using DTO.enums;
using Model; using Model;
namespace ApiLol.Mapper.enums namespace ApiMapping.enums
{ {
public static class RuneFamilyMapper public static class RuneFamilyMapper
{ {

@ -1,7 +1,7 @@
using DTO; using DTO;
using Model; using Model;
namespace ApiLol.Mapper namespace ApiMapping.enums
{ {
public static class SkillTypeMapper public static class SkillTypeMapper
{ {

@ -0,0 +1,184 @@
using ApiMapping;
using DTO;
using Model;
using System.Net.Http.Json;
namespace ApiManager
{
public partial class ApiManagerData
{
public class ChampionsManager : HttpClientManager, IChampionsManager
{
private const string UrlApiChampions = "/api/v2/champions";
public ChampionsManager(HttpClient httpClient) : base(httpClient) { }
public async Task<Champion?> AddItem(Champion? item)
{
try
{
var resp = await _httpClient.PostAsJsonAsync($"{UrlApiChampions}", item.ToDto());
if (resp.IsSuccessStatusCode)
{
var createdItem = await resp.Content.ReadFromJsonAsync<ChampionDto>();
return createdItem?.ToModel();
}
else
{
return null;
}
}
catch (Exception ex)
{
Console.WriteLine($"Error adding champion: {ex.Message}");
return null;
}
}
public async Task<bool> DeleteItem(Champion? item)
{
try
{
var resp = await _httpClient.DeleteAsync($"{UrlApiChampions}/{item?.Name}");
return resp.IsSuccessStatusCode;
}
catch (Exception ex)
{
Console.WriteLine($"Error deleting champion: {ex.Message}");
return false;
}
}
private Func<Champion, string, bool> filterByNameContains = (champ, substring) => champ.Name.Contains(substring, StringComparison.InvariantCultureIgnoreCase);
private Func<Champion, string, bool> filterByName = (champ, substring) => champ.Name.Equals(substring, StringComparison.InvariantCultureIgnoreCase);
public async Task<IEnumerable<Champion?>> GetItemByName(string substring, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
var response = await _httpClient.GetFromJsonAsync<IEnumerable<ChampionDto>>(UrlApiChampions);
return response.Select(c => c.ToModel()).GetItemsWithFilterAndOrdering(champ => filterByName(champ, substring), index, count, orderingPropertyName, descending);
}
public async Task<IEnumerable<Champion?>> GetItems(int index, int count, string? orderingPropertyName = null, bool descending = false)
{
var url = $"{UrlApiChampions}?index={index}&count={count}&orderingPropertyName={orderingPropertyName}&descending={descending}";
var response = await _httpClient.GetFromJsonAsync<IEnumerable<ChampionDto>>(url);
return response.Select(c => c.ToModel());
}
private Func<Champion, string, bool> filterByCharacteristic = (champ, charName) => champ.Characteristics.Keys.Any(k => k.Contains(charName, StringComparison.InvariantCultureIgnoreCase));
public async Task<IEnumerable<Champion?>> GetItemsByCharacteristic(string charName, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
var response = await _httpClient.GetFromJsonAsync<IEnumerable<ChampionDto>>(UrlApiChampions);
return response.Select(c => c.ToModel()).GetItemsWithFilterAndOrdering(
champ => filterByCharacteristic(champ, charName),
index, count, orderingPropertyName, descending);
}
private Func<Champion, ChampionClass, bool> filterByClass = (champ, championClass) => champ.Class == championClass;
public async Task<IEnumerable<Champion?>> GetItemsByClass(ChampionClass championClass, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
var response = await _httpClient.GetFromJsonAsync<IEnumerable<ChampionDto>>(UrlApiChampions);
return response.Select(c => c.ToModel()).GetItemsWithFilterAndOrdering(
champ => filterByClass(champ, championClass),
index, count, orderingPropertyName, descending);
}
public async Task<IEnumerable<Champion?>> GetItemsByName(string substring, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
var response = await _httpClient.GetFromJsonAsync<IEnumerable<ChampionDto>>(UrlApiChampions);
return response.Select(c => c.ToModel()).GetItemsWithFilterAndOrdering(champ => filterByNameContains(champ, substring), index, count, orderingPropertyName, descending);
}
public async Task<IEnumerable<Champion?>> GetItemsByRunePage(RunePage? runePage, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
throw new NotImplementedException();
}
private Func<Champion, Skill?, bool> filterBySkill = (champ, skill) => skill != null && champ.Skills.Contains(skill!);
private static Func<Champion, string, bool> filterBySkillSubstring = (champ, skill) => champ.Skills.Any(s => s.Name.Contains(skill, StringComparison.InvariantCultureIgnoreCase));
public async Task<IEnumerable<Champion?>> GetItemsBySkill(Skill? skill, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
var response = await _httpClient.GetFromJsonAsync<IEnumerable<ChampionDto>>(UrlApiChampions);
return response.Select(c => c.ToModel()).GetItemsWithFilterAndOrdering(champ => filterBySkill(champ, skill), index, count, orderingPropertyName, descending);
}
public async Task<IEnumerable<Champion?>> GetItemsBySkill(string skillSubstring, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
var response = await _httpClient.GetFromJsonAsync<IEnumerable<ChampionDto>>(UrlApiChampions);
return response.Select(c => c.ToModel()).GetItemsWithFilterAndOrdering(champ => filterBySkillSubstring(champ, skillSubstring), index, count, orderingPropertyName, descending);
}
public async Task<int> GetNbItems()
{
var response = await _httpClient.GetAsync("/countChampions");
var content = await response.Content.ReadAsStringAsync();
return int.Parse(content);
}
public async Task<int> GetNbItemsByCharacteristic(string charName)
{
var response = await _httpClient.GetFromJsonAsync<IEnumerable<ChampionDto>>(UrlApiChampions);
return await response.GetNbItemsWithFilter(champ => filterByCharacteristic(champ.ToModel(), charName));
}
public async Task<int> GetNbItemsByClass(ChampionClass championClass)
{
var response = await _httpClient.GetFromJsonAsync<IEnumerable<ChampionDto>>(UrlApiChampions);
return response.Where(c => c.Class.Equals(championClass))
.Count();
}
public async Task<int> GetNbItemsByName(string substring)
{
var response = await _httpClient.GetFromJsonAsync<IEnumerable<ChampionDto>>(UrlApiChampions);
return response.Where(c => c.Name.Equals(substring))
.Count();
}
public Task<int> GetNbItemsByRunePage(RunePage? runePage)
{
throw new NotImplementedException();
}
public async Task<int> GetNbItemsBySkill(Skill? skill)
{
var response = await _httpClient.GetFromJsonAsync<IEnumerable<ChampionDto>>(UrlApiChampions);
return await response.GetNbItemsWithFilter(champ => filterBySkill(champ.ToModel(), skill));
}
public async Task<int> GetNbItemsBySkill(string skill)
{
var response = await _httpClient.GetFromJsonAsync<IEnumerable<ChampionDto>>(UrlApiChampions);
return await response.GetNbItemsWithFilter(champ => filterBySkillSubstring(champ.ToModel(), skill));
}
public async Task<Champion?> UpdateItem(Champion? oldItem, Champion? newItem)
{
try
{
var resp = await _httpClient.PutAsJsonAsync($"{UrlApiChampions}/{oldItem?.Name}", newItem.ToDto());
if (resp.IsSuccessStatusCode)
{
var updatedItem = await resp.Content.ReadFromJsonAsync<ChampionDto>();
return updatedItem?.ToModel();
}
else
{
return null;
}
}
catch (Exception ex)
{
Console.WriteLine($"Error updating champion: {ex.Message}");
return null;
}
}
}
}
}

@ -0,0 +1,145 @@
using DTO;
using Model;
using System.Net.Http.Json;
using ApiMapping;
using System.Data.SqlTypes;
namespace ApiManager
{
public partial class ApiManagerData
{
public class RunePagesManager : HttpClientManager, IRunePagesManager
{
private const string UrlApiRunePages = "/api/RunePages";
public RunePagesManager(HttpClient httpClient) : base(httpClient) { }
public async Task<RunePage?> AddItem(RunePage? item)
{
try
{
var resp = await _httpClient.PostAsJsonAsync($"{UrlApiRunePages}", item.ToDto());
if (resp.IsSuccessStatusCode)
{
var createdItem = await resp.Content.ReadFromJsonAsync<RunePageDto>();
return createdItem?.ToModel();
}
else
{
return null;
}
}
catch (Exception ex)
{
Console.WriteLine($"Error adding runePage: {ex.Message}");
return null;
}
}
public async Task<bool> DeleteItem(RunePage? item)
{
try
{
var resp = await _httpClient.DeleteAsync($"{UrlApiRunePages}/{item?.Name}");
return resp.IsSuccessStatusCode;
}
catch (Exception ex)
{
Console.WriteLine($"Error deleting runePage: {ex.Message}");
return false;
}
}
private static Func<RunePage, string, bool> filterByName
= (rp, substring) => rp.Name.Equals(substring, StringComparison.InvariantCultureIgnoreCase);
private static Func<RunePage, string, bool> filterByNameContains
= (rp, substring) => rp.Name.Contains(substring, StringComparison.InvariantCultureIgnoreCase);
private static Func<RunePage, Rune?, bool> filterByRune
= (rp, rune) => rune != null && rp.Runes.Values.Contains(rune!);
public async Task<IEnumerable<RunePage?>> GetItemByName(string substring, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
var runePages = await _httpClient.GetFromJsonAsync<PageResponse<RunePageDto>>(UrlApiRunePages);
return runePages.Data.Select(r => r.ToModel()).GetItemsWithFilterAndOrdering(
rp => filterByName(rp, substring),
index, count, orderingPropertyName, descending);
}
public async Task<IEnumerable<RunePage?>> GetItems(int index, int count, string? orderingPropertyName = null, bool descending = false)
{
var runePages = await _httpClient.GetFromJsonAsync<PageResponse<RunePageDto>>($"{UrlApiRunePages}?&index={index}&count={count}&descending={descending}");
return runePages.Data.Select(c => c.ToModel());
}
public async Task<IEnumerable<RunePage?>> GetItemsByChampion(Champion? champion, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
throw new NotImplementedException();
}
public async Task<IEnumerable<RunePage?>> GetItemsByName(string substring, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
var runePages = await _httpClient.GetFromJsonAsync<PageResponse<RunePageDto>>(UrlApiRunePages);
return runePages.Data.Select(r => r.ToModel()).GetItemsWithFilterAndOrdering(
rp => filterByNameContains(rp, substring),
index, count, orderingPropertyName, descending);
}
public async Task<IEnumerable<RunePage?>> GetItemsByRune(Rune? rune, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
var runePages = await _httpClient.GetFromJsonAsync<PageResponse<RunePageDto>>(UrlApiRunePages);
return runePages.Data.Select(r => r.ToModel()).GetItemsWithFilterAndOrdering(
rp => filterByRune(rp, rune),
index, count, orderingPropertyName, descending);
}
public async Task<int> GetNbItems()
{
var response = await _httpClient.GetAsync("/countRunePages");
var content = await response.Content.ReadAsStringAsync();
return int.Parse(content);
}
public Task<int> GetNbItemsByChampion(Champion? champion)
{
throw new NotImplementedException();
}
public async Task<int> GetNbItemsByName(string substring)
{
var runePages = await _httpClient.GetFromJsonAsync<PageResponse<RunePageDto>>(UrlApiRunePages);
return await runePages.Data.Select(r => r.ToModel()).GetNbItemsWithFilter(
rp => filterByName(rp, substring));
}
public async Task<int> GetNbItemsByRune(Rune? rune)
{
var runePages = await _httpClient.GetFromJsonAsync<PageResponse<RunePageDto>>(UrlApiRunePages);
return await runePages.Data.Select(r => r.ToModel()).GetNbItemsWithFilter(
rp => filterByRune(rp, rune));
}
public async Task<RunePage?> UpdateItem(RunePage? oldItem, RunePage? newItem)
{
try
{
var resp = await _httpClient.PutAsJsonAsync($"{UrlApiRunePages}/{oldItem?.Name}", newItem.ToDto());
if (resp.IsSuccessStatusCode)
{
var updatedItem = await resp.Content.ReadFromJsonAsync<RunePageDto>();
return updatedItem?.ToModel();
}
else
{
return null;
}
}
catch (Exception ex)
{
Console.WriteLine($"Error updating runePage: {ex.Message}");
return null;
}
}
}
}
}

@ -0,0 +1,138 @@
using DTO;
using Model;
using System.Net.Http.Json;
using ApiMapping;
using System;
using System.Data.SqlTypes;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
namespace ApiManager
{
public partial class ApiManagerData
{
public class RunesManager : HttpClientManager, IRunesManager
{
private const string UrlApiRunes = "/api/runes";
public RunesManager(HttpClient httpClient) : base(httpClient) { }
public async Task<Rune?> AddItem(Rune? item)
{
try
{
var resp = await _httpClient.PostAsJsonAsync($"{UrlApiRunes}", item.ToDto());
if (resp.IsSuccessStatusCode)
{
var createdItem = await resp.Content.ReadFromJsonAsync<RuneDto>();
return createdItem?.ToModel();
}
else
{
return null;
}
}
catch (Exception ex)
{
Console.WriteLine($"Error adding rune: {ex.Message}");
return null;
}
}
public async Task<bool> DeleteItem(Rune? item)
{
try
{
var resp = await _httpClient.DeleteAsync($"{UrlApiRunes}/{item?.Name}");
return resp.IsSuccessStatusCode;
}
catch (Exception ex)
{
Console.WriteLine($"Error deleting rune: {ex.Message}");
return false;
}
}
private static Func<Rune, RuneFamily, bool> filterByRuneFamily
= (rune, family) => rune.Family == family;
private static Func<Rune, string, bool> filterByName
= (rune, substring) => rune.Name.Equals(substring, StringComparison.InvariantCultureIgnoreCase);
private static Func<Rune, string, bool> filterByNameContains
= (rune, substring) => rune.Name.Contains(substring, StringComparison.InvariantCultureIgnoreCase);
public async Task<IEnumerable<Rune?>> GetItemByName(string substring, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
var runes = await _httpClient.GetFromJsonAsync<PageResponse<RuneDto>>(UrlApiRunes);
return runes.Data.Select(r => r.ToModel()).GetItemsWithFilterAndOrdering(
rune => filterByName(rune, substring),
index, count, orderingPropertyName, descending);
}
public async Task<IEnumerable<Rune?>> GetItems(int index, int count, string? orderingPropertyName = null, bool descending = false)
{
var runes = await _httpClient.GetFromJsonAsync<PageResponse<RuneDto>>($"{UrlApiRunes}?&index={index}&count={count}&descending={descending}");
return runes.Data.Select(c => c.ToModel());
}
public async Task<IEnumerable<Rune?>> GetItemsByFamily(RuneFamily family, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
var runes = await _httpClient.GetFromJsonAsync<PageResponse<RuneDto>>(UrlApiRunes);
return runes.Data.Select(r => r.ToModel()).GetItemsWithFilterAndOrdering(
rune => filterByRuneFamily(rune, family),
index, count, orderingPropertyName, descending);
}
public async Task<IEnumerable<Rune?>> GetItemsByName(string substring, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
var runes = await _httpClient.GetFromJsonAsync<PageResponse<RuneDto>>(UrlApiRunes);
return runes.Data.Select(r => r.ToModel()).GetItemsWithFilterAndOrdering(
rune => filterByNameContains(rune, substring),
index, count, orderingPropertyName, descending);
}
public async Task<int> GetNbItems()
{
var response = await _httpClient.GetAsync("/countRunes");
var content = await response.Content.ReadAsStringAsync();
return int.Parse(content);
}
public async Task<int> GetNbItemsByFamily(RuneFamily family)
{
var runes = await _httpClient.GetFromJsonAsync<PageResponse<RuneDto>>(UrlApiRunes);
return await runes.Data.Select(r => r.ToModel()).GetNbItemsWithFilter(
rune => filterByRuneFamily(rune, family));
}
public async Task<int> GetNbItemsByName(string substring)
{
var runes = await _httpClient.GetFromJsonAsync<PageResponse<RuneDto>>(UrlApiRunes);
return await runes.Data.Select(r => r.ToModel()).GetNbItemsWithFilter(
rune => filterByName(rune, substring));
}
public async Task<Rune?> UpdateItem(Rune? oldItem, Rune? newItem)
{
try
{
var resp = await _httpClient.PutAsJsonAsync($"{UrlApiRunes}/{oldItem?.Name}", newItem.ToDto());
if (resp.IsSuccessStatusCode)
{
var updatedItem = await resp.Content.ReadFromJsonAsync<RuneDto>();
return updatedItem?.ToModel();
}
else
{
return null;
}
}
catch (Exception ex)
{
Console.WriteLine($"Error updating rune: {ex.Message}");
return null;
}
}
}
}
}

@ -0,0 +1,178 @@
using DTO;
using Model;
using System.Net.Http.Json;
using ApiMapping;
using System.Data.SqlTypes;
namespace ApiManager
{
public partial class ApiManagerData
{
public class SkinsManager : HttpClientManager, ISkinsManager
{
private const string UrlApiSkins = "/api/Skins";
public SkinsManager(HttpClient httpClient) : base(httpClient) { }
public async Task<Skin?> AddItem(Skin? item)
{
try
{
var resp = await _httpClient.PostAsJsonAsync($"{UrlApiSkins}", item.ToDtoC());
if (resp.IsSuccessStatusCode)
{
var createdItem = await resp.Content.ReadFromJsonAsync<SkinDtoC>();
var championManager = new ChampionsManager(_httpClient);
var champ = await championManager.GetItemByName(createdItem.ChampionName, 0, 1);
return createdItem?.ToModelC(champ.First());
}
else
{
return null;
}
}
catch (Exception ex)
{
Console.WriteLine($"Error adding skin: {ex.Message}");
return null;
}
}
public async Task<bool> DeleteItem(Skin? item)
{
try
{
var resp = await _httpClient.DeleteAsync($"{UrlApiSkins}/{item?.Name}");
return resp.IsSuccessStatusCode;
}
catch (Exception ex)
{
Console.WriteLine($"Error deleting skin: {ex.Message}");
return false;
}
}
public async Task<IEnumerable<Skin?>> GetItemByName(string substring, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
var dtoSkins = await _httpClient.GetFromJsonAsync<PageResponse<SkinDtoC>>(UrlApiSkins);
var skins = new List<Skin>();
var championManager = new ChampionsManager(_httpClient);
foreach (var skin in dtoSkins.Data)
{
var champ = await championManager.GetItemByName(skin.ChampionName, 0, 1);
skins.Add(skin.ToModelC(champ.First()));
}
return skins.GetItemsWithFilterAndOrdering(
skin => filterByName(skin, substring),
index, count, orderingPropertyName, descending);
}
public async Task<IEnumerable<Skin?>> GetItems(int index, int count, string? orderingPropertyName = null, bool descending = false)
{
var dtoSkins = await _httpClient.GetFromJsonAsync<PageResponse<SkinDtoC>>($"{UrlApiSkins}?&index={index}&count={count}&descending={descending}");
var skins = new List<Skin>();
var championManager = new ChampionsManager(_httpClient);
foreach (var skin in dtoSkins.Data)
{
var champ = await championManager.GetItemByName(skin.ChampionName, 0, 1);
skins.Add(skin.ToModelC(champ.First()));
}
return skins;
}
public async Task<IEnumerable<Skin?>> GetItemsByChampion(Champion? champion, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
var dtoSkins = await _httpClient.GetFromJsonAsync<PageResponse<SkinDtoC>>(UrlApiSkins);
var skins = new List<Skin>();
var championManager = new ChampionsManager(_httpClient);
foreach (var skin in dtoSkins.Data)
{
var champ = await championManager.GetItemByName(skin.ChampionName, 0, 1);
skins.Add(skin.ToModelC(champ.First()));
}
return skins.GetItemsWithFilterAndOrdering(
skin => filterByChampion(skin, champion),
index, count, orderingPropertyName, descending);
}
private static Func<Skin, Champion?, bool> filterByChampion = (skin, champion) => champion != null && skin.Champion.Equals(champion!);
private static Func<Skin, string, bool> filterByName = (skin, substring) => skin.Name.Equals(substring, StringComparison.InvariantCultureIgnoreCase);
private static Func<Skin, string, bool> filterByNameContains = (skin, substring) => skin.Name.Contains(substring, StringComparison.InvariantCultureIgnoreCase);
public async Task<IEnumerable<Skin?>> GetItemsByName(string substring, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
var dtoSkins = await _httpClient.GetFromJsonAsync<PageResponse<SkinDtoC>>(UrlApiSkins);
var skins = new List<Skin>();
var championManager = new ChampionsManager(_httpClient);
foreach (var skin in dtoSkins.Data)
{
var champ = await championManager.GetItemByName(skin.ChampionName,0,1);
skins.Add(skin.ToModelC(champ.First()));
}
return skins.GetItemsWithFilterAndOrdering(
skin => filterByNameContains(skin, substring),
index, count, orderingPropertyName, descending);
}
public async Task<int> GetNbItems()
{
var response = await _httpClient.GetAsync("/countSkins");
var content = await response.Content.ReadAsStringAsync();
return int.Parse(content);
}
public async Task<int> GetNbItemsByChampion(Champion? champion)
{
var dtoSkins = await _httpClient.GetFromJsonAsync<PageResponse<SkinDtoC>>(UrlApiSkins);
var skins = new List<Skin>();
var championManager = new ChampionsManager(_httpClient);
foreach (var skin in dtoSkins.Data)
{
var champ = await championManager.GetItemByName(skin.ChampionName, 0, 1);
skins.Add(skin.ToModelC(champ.First()));
}
return await skins.GetNbItemsWithFilter(
skin => filterByChampion(skin, champion));
}
public async Task<int> GetNbItemsByName(string substring)
{
var dtoSkins = await _httpClient.GetFromJsonAsync<PageResponse<SkinDtoC>>(UrlApiSkins);
var skins = new List<Skin>();
var championManager = new ChampionsManager(_httpClient);
foreach (var skin in dtoSkins.Data)
{
var champ = await championManager.GetItemByName(skin.ChampionName, 0, 1);
skins.Add(skin.ToModelC(champ.First()));
}
return await skins.GetNbItemsWithFilter(
skin => filterByName(skin, substring));
}
public async Task<Skin?> UpdateItem(Skin? oldItem, Skin? newItem)
{
try
{
var resp = await _httpClient.PutAsJsonAsync($"{UrlApiSkins}/{oldItem?.Name}", newItem.ToDto());
if (resp.IsSuccessStatusCode)
{
var updatedItem = await resp.Content.ReadFromJsonAsync<SkinDtoC>();
var championManager = new ChampionsManager(_httpClient);
var champ = await championManager.GetItemByName(updatedItem.ChampionName, 0, 1);
return updatedItem?.ToModelC(champ.First());
}
else
{
return null;
}
}
catch (Exception ex)
{
Console.WriteLine($"Error updating skin: {ex.Message}");
return null;
}
}
}
}
}

@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ApiLol\ApiLol.csproj" /> <ProjectReference Include="..\ApiMapping\ApiMapping.csproj" />
<ProjectReference Include="..\DTO\DTO.csproj" /> <ProjectReference Include="..\DTO\DTO.csproj" />
<ProjectReference Include="..\Model\Model.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -0,0 +1,24 @@
using Model;
namespace ApiManager
{
public partial class ApiManagerData : IDataManager
{
public ApiManagerData(HttpClient httpClient)
{
ChampionsMgr = new ChampionsManager(httpClient);
SkinsMgr = new SkinsManager(httpClient);
RunesMgr = new RunesManager(httpClient);
RunePagesMgr = new RunePagesManager(httpClient);
}
public IChampionsManager ChampionsMgr { get; set; }
public ISkinsManager SkinsMgr { get; set; }
public IRunesManager RunesMgr { get; set; }
public IRunePagesManager RunePagesMgr { get; set; }
}
}

@ -1,43 +0,0 @@
using DTO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Json;
using System.Text;
using System.Threading.Tasks;
namespace Client
{
public class ChampionHttpClient
{
private const string UrlApiChampions = "/api/v3/champions";
private readonly HttpClient _httpClient;
public ChampionHttpClient(HttpClient httpClient)
{
_httpClient = httpClient;
httpClient.BaseAddress = new Uri("https://localhost:7252");
}
public async Task<IEnumerable<ChampionDto>> GetChampion(int index, int count)
{
var url = $"{UrlApiChampions}?index={index}&count={count}";
var Response = await _httpClient.GetFromJsonAsync<PageResponse<ChampionDto>>(url);
return Response.Data;
}
/* public async void Add(ChampionDto champion)
{
await _httpClient.PostAsJsonAsync<ChampionDto>(ApiChampions, champion);
}*/
/* public async void Delete(ChampionDto champion)
{
await _httpClient.DeleteAsync(champion.Name);
}
public async void Update(ChampionDto champion)
{
await _httpClient.PutAsJsonAsync<ChampionDto>(ApiChampions, champion);
}*/
}
}

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApiManager
{
static class Extensions
{
internal static IEnumerable<T?> GetItemsWithFilterAndOrdering<T>(this IEnumerable<T> collection,
Func<T, bool> filter, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
IEnumerable<T> temp = collection;
temp = temp.Where(item => filter(item));
if (orderingPropertyName != null)
{
var prop = typeof(T).GetProperty(orderingPropertyName!);
if (prop != null)
{
temp = descending ? temp.OrderByDescending(item => prop.GetValue(item))
: temp.OrderBy(item => prop.GetValue(item));
}
}
return temp.Skip(index * count).Take(count);
}
internal static Task<int> GetNbItemsWithFilter<T>(this IEnumerable<T> collection, Func<T, bool> filter)
{
return Task.FromResult(collection.Count(item => filter(item)));
}
}
}

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApiManager
{
public class HttpClientManager
{
protected readonly HttpClient _httpClient;
public HttpClientManager(HttpClient httpClient)
{
_httpClient = httpClient;
_httpClient.BaseAddress = new Uri("https://localhost:7252");
}
}
}

@ -1,19 +1,18 @@
// See https://aka.ms/new-console-template for more information /*// See https://aka.ms/new-console-template for more information
using Client; using static ApiManager.ApiManagerData;
using DTO;
Console.WriteLine("Hello, World!"); Console.WriteLine("Hello, World!");
var championClient = new ChampionHttpClient(new HttpClient()); var championClient = new ChampionsManager(new HttpClient());
// Get all champions // Get all champions
var champions = await championClient.GetChampion(0,6); var champions = await championClient.GetItems(0,6);
Console.WriteLine("All champions:"); Console.WriteLine("All champions:");
foreach (var champion in champions) foreach (var champion in champions)
{ {
Console.WriteLine($"{champion.Name} ({champion.Bio})"); Console.WriteLine($"{champion.Name} ({champion.Bio})");
} }
/*// Add a new champion *//*// Add a new champion
var newChampion = new ChampionDto { Name = "Akali", Role = "Assassin" }; var newChampion = new ChampionDto { Name = "Akali", Role = "Assassin" };
championClient.Add(newChampion); championClient.Add(newChampion);
@ -34,6 +33,6 @@ if (championToUpdate != null)
Console.WriteLine($"{championToUpdate.Name} updated."); Console.WriteLine($"{championToUpdate.Name} updated.");
} }
*/ *//*
Console.ReadLine(); Console.ReadLine();*/

@ -47,9 +47,12 @@ namespace DbLib
index, count, orderingPropertyName, descending).Select(c => c.ToModel(parent.DbContext)); index, count, orderingPropertyName, descending).Select(c => c.ToModel(parent.DbContext));
public async Task<IEnumerable<RunePage?>> GetItems(int index, int count, string? orderingPropertyName = null, bool descending = false) public async Task<IEnumerable<RunePage?>> GetItems(int index, int count, string? orderingPropertyName = null, bool descending = false)
=> parent.DbContext.RunePages.Include(rp => rp.Champions).Include(rp => rp.DictionaryCategoryRunes).GetItemsWithFilterAndOrdering( {
parent.DbContext.Runes.Include(r => r.Image);
return parent.DbContext.RunePages.Include(rp => rp.Champions).Include(rp => rp.DictionaryCategoryRunes).Include(rp => rp.DictionaryCategoryRunes).GetItemsWithFilterAndOrdering(
rp => true, rp => true,
index, count, orderingPropertyName, descending).Select(c => c.ToModel(parent.DbContext)); index, count, orderingPropertyName, descending).Select(c => c.ToModel(parent.DbContext));
}
public async Task<IEnumerable<RunePage?>> GetItemsByChampion(Champion? champion, int index, int count, string? orderingPropertyName = null, bool descending = false) public async Task<IEnumerable<RunePage?>> GetItemsByChampion(Champion? champion, int index, int count, string? orderingPropertyName = null, bool descending = false)
=> parent.DbContext.RunePages.Include(rp => rp.Champions).Include(rp => rp.DictionaryCategoryRunes).GetItemsWithFilterAndOrdering( => parent.DbContext.RunePages.Include(rp => rp.Champions).Include(rp => rp.DictionaryCategoryRunes).GetItemsWithFilterAndOrdering(

@ -1,5 +1,4 @@
using Microsoft.EntityFrameworkCore; using Model;
using Model;
using MyFlib; using MyFlib;
namespace DbLib namespace DbLib

@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>

@ -15,7 +15,7 @@ namespace DbManager.Mapper
} }
foreach (var skin in championEntity.Skins) foreach (var skin in championEntity.Skins)
{ {
champion.AddSkin(new Skin(skin.Name, champion, skin.Price, skin.Icon, skin.Image.Base64, skin.Description)); champion.AddSkin(new Skin(skin.Name, champion, skin.Price, skin.Icon, "", skin.Description));
} }
if (championEntity.Characteristics != null) if (championEntity.Characteristics != null)
{ {

@ -6,7 +6,7 @@ namespace DbManager.Mapper
{ {
public static class RuneMapper public static class RuneMapper
{ {
public static Rune ToModel(this RuneEntity rune) => new(rune.Name, rune.Family.ToModel(), rune.Icon, rune.Image.Base64, rune.Description); public static Rune ToModel(this RuneEntity rune) => new(rune.Name, rune.Family.ToModel(), rune.Icon, "", rune.Description);
public static RuneEntity ToEntity(this Rune rune) public static RuneEntity ToEntity(this Rune rune)
=> new() => new()
{ {

@ -1,4 +1,5 @@
using DbManager.Mapper.enums; using DbManager.Mapper.enums;
using Microsoft.EntityFrameworkCore;
using Model; using Model;
using MyFlib; using MyFlib;
using MyFlib.Entities; using MyFlib.Entities;

@ -1,2 +0,0 @@
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");

@ -33,6 +33,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LolApp", "LolApp\LolApp.csp
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ViewModels", "ViewModels\ViewModels.csproj", "{65135247-E1AB-4EE4-9473-DFDE6AFCC250}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ViewModels", "ViewModels\ViewModels.csproj", "{65135247-E1AB-4EE4-9473-DFDE6AFCC250}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiMapping", "ApiMapping\ApiMapping.csproj", "{F8D44A32-788B-4E63-B379-278B90216E28}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -93,6 +95,10 @@ Global
{65135247-E1AB-4EE4-9473-DFDE6AFCC250}.Debug|Any CPU.Build.0 = Debug|Any CPU {65135247-E1AB-4EE4-9473-DFDE6AFCC250}.Debug|Any CPU.Build.0 = Debug|Any CPU
{65135247-E1AB-4EE4-9473-DFDE6AFCC250}.Release|Any CPU.ActiveCfg = Release|Any CPU {65135247-E1AB-4EE4-9473-DFDE6AFCC250}.Release|Any CPU.ActiveCfg = Release|Any CPU
{65135247-E1AB-4EE4-9473-DFDE6AFCC250}.Release|Any CPU.Build.0 = Release|Any CPU {65135247-E1AB-4EE4-9473-DFDE6AFCC250}.Release|Any CPU.Build.0 = Release|Any CPU
{F8D44A32-788B-4E63-B379-278B90216E28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F8D44A32-788B-4E63-B379-278B90216E28}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F8D44A32-788B-4E63-B379-278B90216E28}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F8D44A32-788B-4E63-B379-278B90216E28}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

@ -82,6 +82,7 @@
<MauiImage Include="Resources\Images\rp.png" /> <MauiImage Include="Resources\Images\rp.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Client\ApiManager.csproj" />
<ProjectReference Include="..\Model\Model.csproj" /> <ProjectReference Include="..\Model\Model.csproj" />
<ProjectReference Include="..\Shared\Shared.csproj" /> <ProjectReference Include="..\Shared\Shared.csproj" />
<ProjectReference Include="..\StubLib\StubLib.csproj" /> <ProjectReference Include="..\StubLib\StubLib.csproj" />

@ -1,39 +1,38 @@
using CommunityToolkit.Maui; using ApiManager;
using LolApp.ViewModels; using CommunityToolkit.Maui;
using Microsoft.Extensions.Logging; using LolApp.ViewModels;
using Microsoft.Maui.Handlers; using Microsoft.Extensions.Logging;
using Microsoft.Maui.Platform; using Model;
using Model; using StubLib;
using StubLib; using ViewModels;
using ViewModels;
namespace LolApp;
namespace LolApp;
public static class MauiProgram
public static class MauiProgram {
{ public static MauiApp CreateMauiApp()
public static MauiApp CreateMauiApp() {
{ var builder = MauiApp.CreateBuilder();
var builder = MauiApp.CreateBuilder(); builder
builder .UseMauiApp<App>()
.UseMauiApp<App>() .UseMauiCommunityToolkit()
.UseMauiCommunityToolkit() .ConfigureFonts(fonts =>
.ConfigureFonts(fonts => {
{ fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); fonts.AddFont("Font Awesome 6 Free-Solid-900.otf", "FASolid");
fonts.AddFont("Font Awesome 6 Free-Solid-900.otf", "FASolid"); });
}); builder.Services.AddSingleton<IDataManager, StubData>()
builder.Services.AddSingleton<IDataManager, StubData>() .AddSingleton<ChampionsMgrVM>()
.AddSingleton<ChampionsMgrVM>() .AddSingleton<SkinsMgrVM>()
.AddSingleton<SkinsMgrVM>() .AddSingleton<ApplicationVM>()
.AddSingleton<ApplicationVM>() .AddSingleton<ChampionsPage>();
.AddSingleton<ChampionsPage>();
#if DEBUG
#if DEBUG builder.Logging.AddDebug();
builder.Logging.AddDebug(); #endif
#endif
return builder.Build();
return builder.Build(); }
} }
}

@ -33,8 +33,8 @@ namespace MyFlib
protected override void OnModelCreating(ModelBuilder modelBuilder) protected override void OnModelCreating(ModelBuilder modelBuilder)
{ {
//LargeImageEntity //LargeImageEntity
LargeImageEntity image1 = new LargeImageEntity { Id = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}"), Base64 = "empty" }; LargeImageEntity image1 = new LargeImageEntity { Id = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}"), Base64 = "UklGRtwDAABXRUJQVlA4INADAAAwEACdASoqACoAAMASJZgCdMoSCz655ndU4XXAP2yXIge5neM/Qd6WCfO8evoj2S0A/p7+f0An85cBxlLDgPC8jO/0nsl/13/O8vvzj7Af8s/p3/H4FU6td4MCwq23z1H2uzoKIXaqJniPI/bRMf8qzv0Zp+HE1RCBw5WQ1j/JovdM1FS52+QcaAAA/v/+NxU4DpPk3+xQPW7tcmURSo9vC4qc+XMxNVBzEM5E8actDz98gmwTXgD62e9EmG/ervdd2ovFFSuxYppWl/wtaX3rkn0xrt8qOql/5I2jfLOnCU0kALLcW4F/wTjU10qsxZXW9fxauC6OPVRF28sc94V9ocmoSWy+sf6jW3vYkVOh+gE/RE0L6b2d3oFyHmkRJnfYwG8o3p6fv9pivNF5aopIBzFnjzwb/VqSq3/b+MWKFmjr8T1qe4/fITo2vBWEqDyogV3ZVGnDVi2DbiEFVSUr2eXTNZQ9V/D9QC/+vCR5TGyX9QOVBgtAYtm/ZTIwzPEYB9NrV1NeO1/sAz78u0tW59r0I+SO5Jgm3B9i1toRurzHv9EZJ9yZL8nafb/T1FaoPDkuJfM+iPs0j8xnS7TaU/gEK0wCxeDYRYtJx9j4hUQq7pAu/T2yWy0vjcUHki952ZNbXnXxB8m8pV5x9E1sfLj5MZEgpU2XV8RHrVvWniCjsf6vgxmR7+KtwIbMjahitUGtHet1WdL+8MmdL29iQJC37pDXirir1NibxKKhFYRuJ3xW9O0r9+Vnh8diqbBuXqDbYR/MSoHvscOCm2t95dN5WBdRUoD7YCG/ZHWc7Ypv/x/al4fkB2lZlYhVWHxjaoeF9jEPI0gAN5XsvUI6hbzEzWMsNW/1orkNOnlskalgmpI4B2rm4Gc7LNui+MuMBrpnBvLkbYX9exe9g8tu7wLt7ScOjDcL99oOyR89Mh9L8rd4+43+JQyR6tsIfcPJo6T6FxHf11d/MGayJi+SWct/uhvvua0oOh+zXNIaUzgoBmu1XULjkpuA0Ghzctf30jbY1AOM49qbMZRYS9A+0S1HrHPnwRvpQY/Sj4xKPn0gdpv/+iTbKJb8zkPC4/9af0Jvesa+GDG0/iw3TswenMhqlh7BM9MW5txpeblsByx4WnJ/oHv6cc0dmM7tsV36lYkCTUXEf/0eKlnfivnN0g1g+j/Lk9et/uoa6TFCW0HgwFOIVFumEYdT675PfuTrYO5o8ZrWEIHtv2Ctlrv9J3TrslD/iKEwtipGHtn0Vak8B9wLL+kz+CIQ/VG4KJpXjx88CeCC4XaGitEdjAAA" };
LargeImageEntity image2 = new LargeImageEntity { Id = Guid.Parse("{9f9086f5-5cc5-47b5-af9b-a935f4e9b89c}"), Base64 = " " }; LargeImageEntity image2 = new LargeImageEntity { Id = Guid.Parse("{9f9086f5-5cc5-47b5-af9b-a935f4e9b89c}"), Base64 = "UklGRtwDAABXRUJQVlA4INADAAAwEACdASoqACoAAMASJZgCdMoSCz655ndU4XXAP2yXIge5neM/Qd6WCfO8evoj2S0A/p7+f0An85cBxlLDgPC8jO/0nsl/13/O8vvzj7Af8s/p3/H4FU6td4MCwq23z1H2uzoKIXaqJniPI/bRMf8qzv0Zp+HE1RCBw5WQ1j/JovdM1FS52+QcaAAA/v/+NxU4DpPk3+xQPW7tcmURSo9vC4qc+XMxNVBzEM5E8actDz98gmwTXgD62e9EmG/ervdd2ovFFSuxYppWl/wtaX3rkn0xrt8qOql/5I2jfLOnCU0kALLcW4F/wTjU10qsxZXW9fxauC6OPVRF28sc94V9ocmoSWy+sf6jW3vYkVOh+gE/RE0L6b2d3oFyHmkRJnfYwG8o3p6fv9pivNF5aopIBzFnjzwb/VqSq3/b+MWKFmjr8T1qe4/fITo2vBWEqDyogV3ZVGnDVi2DbiEFVSUr2eXTNZQ9V/D9QC/+vCR5TGyX9QOVBgtAYtm/ZTIwzPEYB9NrV1NeO1/sAz78u0tW59r0I+SO5Jgm3B9i1toRurzHv9EZJ9yZL8nafb/T1FaoPDkuJfM+iPs0j8xnS7TaU/gEK0wCxeDYRYtJx9j4hUQq7pAu/T2yWy0vjcUHki952ZNbXnXxB8m8pV5x9E1sfLj5MZEgpU2XV8RHrVvWniCjsf6vgxmR7+KtwIbMjahitUGtHet1WdL+8MmdL29iQJC37pDXirir1NibxKKhFYRuJ3xW9O0r9+Vnh8diqbBuXqDbYR/MSoHvscOCm2t95dN5WBdRUoD7YCG/ZHWc7Ypv/x/al4fkB2lZlYhVWHxjaoeF9jEPI0gAN5XsvUI6hbzEzWMsNW/1orkNOnlskalgmpI4B2rm4Gc7LNui+MuMBrpnBvLkbYX9exe9g8tu7wLt7ScOjDcL99oOyR89Mh9L8rd4+43+JQyR6tsIfcPJo6T6FxHf11d/MGayJi+SWct/uhvvua0oOh+zXNIaUzgoBmu1XULjkpuA0Ghzctf30jbY1AOM49qbMZRYS9A+0S1HrHPnwRvpQY/Sj4xKPn0gdpv/+iTbKJb8zkPC4/9af0Jvesa+GDG0/iw3TswenMhqlh7BM9MW5txpeblsByx4WnJ/oHv6cc0dmM7tsV36lYkCTUXEf/0eKlnfivnN0g1g+j/Lk9et/uoa6TFCW0HgwFOIVFumEYdT675PfuTrYO5o8ZrWEIHtv2Ctlrv9J3TrslD/iKEwtipGHtn0Vak8B9wLL+kz+CIQ/VG4KJpXjx88CeCC4XaGitEdjAAA" };
modelBuilder.Entity<LargeImageEntity>().HasData(image1, image2); modelBuilder.Entity<LargeImageEntity>().HasData(image1, image2);

@ -1,671 +0,0 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using MyFlib;
#nullable disable
namespace MyFlib.Migrations
{
[DbContext(typeof(LolDbContext))]
[Migration("20230325231552_myMigration")]
partial class myMigration
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.2");
modelBuilder.Entity("ChampionEntityRunePageEntity", b =>
{
b.Property<Guid>("ChampionsId")
.HasColumnType("TEXT");
b.Property<string>("RunePagesName")
.HasColumnType("TEXT");
b.HasKey("ChampionsId", "RunePagesName");
b.HasIndex("RunePagesName");
b.ToTable("ChampionEntityRunePageEntity");
});
modelBuilder.Entity("MyFlib.ChampionEntity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Bio")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<int>("Class")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid>("ImageId")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ImageId");
b.ToTable("Champions");
b.HasData(
new
{
Id = new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"),
Bio = "",
Class = 1,
Icon = "",
ImageId = new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"),
Name = "Akali"
},
new
{
Id = new Guid("a4f84d92-c20f-4f2d-b3f9-ca00ef556e72"),
Bio = "",
Class = 2,
Icon = "",
ImageId = new Guid("9f9086f5-5cc5-47b5-af9b-a935f4e9b89c"),
Name = "Aatrox"
},
new
{
Id = new Guid("ae5fe535-f041-445e-b570-28b75bc78cb9"),
Bio = "",
Class = 3,
Icon = "",
ImageId = new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"),
Name = "Ahri"
},
new
{
Id = new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"),
Bio = "",
Class = 4,
Icon = "",
ImageId = new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"),
Name = "Akshan"
},
new
{
Id = new Guid("7f7746fa-b1cb-49da-9409-4b3e6910500e"),
Bio = "",
Class = 5,
Icon = "",
ImageId = new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"),
Name = "Bard"
},
new
{
Id = new Guid("36ad2a82-d17b-47de-8a95-6e154a7df557"),
Bio = "",
Class = 6,
Icon = "",
ImageId = new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"),
Name = "Alistar"
});
});
modelBuilder.Entity("MyFlib.DictionaryCategoryRune", b =>
{
b.Property<string>("RunePageName")
.HasColumnType("TEXT");
b.Property<string>("RuneName")
.HasColumnType("TEXT");
b.Property<int>("category")
.HasColumnType("INTEGER");
b.HasKey("RunePageName", "RuneName");
b.HasIndex("RuneName");
b.ToTable("CategoryRunes");
b.HasData(
new
{
RunePageName = "Page 1",
RuneName = "Hextech Flashtraption ",
category = 0
},
new
{
RunePageName = "Page 1",
RuneName = "Manaflow Band ",
category = 1
},
new
{
RunePageName = "Page 2",
RuneName = "Manaflow Band ",
category = 4
},
new
{
RunePageName = "Page 2",
RuneName = "Hextech Flashtraption ",
category = 5
});
});
modelBuilder.Entity("MyFlib.Entities.CharacteristicEntity", b =>
{
b.Property<string>("Name")
.HasMaxLength(254)
.HasColumnType("TEXT");
b.Property<Guid>("ChampionForeignKey")
.HasColumnType("TEXT");
b.Property<int>("Value")
.HasColumnType("INTEGER");
b.HasKey("Name", "ChampionForeignKey");
b.HasIndex("ChampionForeignKey");
b.ToTable("Characteristic");
b.HasData(
new
{
Name = "Attack Damage",
ChampionForeignKey = new Guid("ae5fe535-f041-445e-b570-28b75bc78cb9"),
Value = 58
},
new
{
Name = "Ability Power",
ChampionForeignKey = new Guid("ae5fe535-f041-445e-b570-28b75bc78cb9"),
Value = 92
},
new
{
Name = "Attack Speed",
ChampionForeignKey = new Guid("ae5fe535-f041-445e-b570-28b75bc78cb9"),
Value = 6
},
new
{
Name = "Health",
ChampionForeignKey = new Guid("ae5fe535-f041-445e-b570-28b75bc78cb9"),
Value = 526
},
new
{
Name = "Mana",
ChampionForeignKey = new Guid("ae5fe535-f041-445e-b570-28b75bc78cb9"),
Value = 418
},
new
{
Name = "Attack Damage",
ChampionForeignKey = new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"),
Value = 68
},
new
{
Name = "Ability Power",
ChampionForeignKey = new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"),
Value = 0
},
new
{
Name = "Attack Speed",
ChampionForeignKey = new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"),
Value = 1
},
new
{
Name = "Health",
ChampionForeignKey = new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"),
Value = 570
},
new
{
Name = "Mana",
ChampionForeignKey = new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"),
Value = 350
},
new
{
Name = "Attack Damage",
ChampionForeignKey = new Guid("a4f84d92-c20f-4f2d-b3f9-ca00ef556e72"),
Value = 70
},
new
{
Name = "Ability Power",
ChampionForeignKey = new Guid("a4f84d92-c20f-4f2d-b3f9-ca00ef556e72"),
Value = 0
},
new
{
Name = "Attack Speed",
ChampionForeignKey = new Guid("a4f84d92-c20f-4f2d-b3f9-ca00ef556e72"),
Value = 1
},
new
{
Name = "Health",
ChampionForeignKey = new Guid("a4f84d92-c20f-4f2d-b3f9-ca00ef556e72"),
Value = 580
},
new
{
Name = "Mana",
ChampionForeignKey = new Guid("a4f84d92-c20f-4f2d-b3f9-ca00ef556e72"),
Value = 0
},
new
{
Name = "Attack Damage",
ChampionForeignKey = new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"),
Value = 56
},
new
{
Name = "Ability Power",
ChampionForeignKey = new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"),
Value = 0
},
new
{
Name = "Attack Speed",
ChampionForeignKey = new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"),
Value = 1
},
new
{
Name = "Health",
ChampionForeignKey = new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"),
Value = 575
},
new
{
Name = "Mana",
ChampionForeignKey = new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"),
Value = 200
},
new
{
Name = "Attack Damage",
ChampionForeignKey = new Guid("36ad2a82-d17b-47de-8a95-6e154a7df557"),
Value = 63
},
new
{
Name = "Ability Power",
ChampionForeignKey = new Guid("36ad2a82-d17b-47de-8a95-6e154a7df557"),
Value = 0
},
new
{
Name = "Attack Speed",
ChampionForeignKey = new Guid("36ad2a82-d17b-47de-8a95-6e154a7df557"),
Value = 2
},
new
{
Name = "Health",
ChampionForeignKey = new Guid("36ad2a82-d17b-47de-8a95-6e154a7df557"),
Value = 573
},
new
{
Name = "Mana",
ChampionForeignKey = new Guid("36ad2a82-d17b-47de-8a95-6e154a7df557"),
Value = 278
},
new
{
Name = "Ability Power",
ChampionForeignKey = new Guid("7f7746fa-b1cb-49da-9409-4b3e6910500e"),
Value = 30
},
new
{
Name = "Attack Speed",
ChampionForeignKey = new Guid("7f7746fa-b1cb-49da-9409-4b3e6910500e"),
Value = 1
},
new
{
Name = "Health",
ChampionForeignKey = new Guid("7f7746fa-b1cb-49da-9409-4b3e6910500e"),
Value = 535
},
new
{
Name = "Mana",
ChampionForeignKey = new Guid("7f7746fa-b1cb-49da-9409-4b3e6910500e"),
Value = 350
});
});
modelBuilder.Entity("MyFlib.Entities.RunePageEntity", b =>
{
b.Property<string>("Name")
.HasMaxLength(64)
.HasColumnType("TEXT");
b.HasKey("Name");
b.ToTable("RunePages");
b.HasData(
new
{
Name = "Page 1"
},
new
{
Name = "Page 2"
});
});
modelBuilder.Entity("MyFlib.LargeImageEntity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Base64")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("LargeImages");
b.HasData(
new
{
Id = new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"),
Base64 = "empty"
},
new
{
Id = new Guid("9f9086f5-5cc5-47b5-af9b-a935f4e9b89c"),
Base64 = " "
});
});
modelBuilder.Entity("MyFlib.RuneEntity", b =>
{
b.Property<string>("Name")
.HasMaxLength(64)
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT");
b.Property<int>("Family")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid>("ImageId")
.HasColumnType("TEXT");
b.HasKey("Name");
b.HasIndex("ImageId");
b.ToTable("Runes");
b.HasData(
new
{
Name = "Hextech Flashtraption ",
Description = "While Flash is on cooldown, it is replaced by Hexflash.",
Family = 0,
Icon = "",
ImageId = new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65")
},
new
{
Name = "Manaflow Band ",
Description = "Hitting enemy champions with a spell grants 25 maximum mana, up to 250 mana.",
Family = 2,
Icon = "",
ImageId = new Guid("9f9086f5-5cc5-47b5-af9b-a935f4e9b89c")
});
});
modelBuilder.Entity("MyFlib.SkillEntity", b =>
{
b.Property<string>("Name")
.HasMaxLength(64)
.HasColumnType("TEXT");
b.Property<Guid>("ChampionForeignKey")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.HasKey("Name");
b.HasIndex("ChampionForeignKey");
b.ToTable("Skills");
b.HasData(
new
{
Name = "Boule de feu",
ChampionForeignKey = new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"),
Description = "Fire!",
Type = 1
},
new
{
Name = "White Star",
ChampionForeignKey = new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"),
Description = "Random damage",
Type = 3
});
});
modelBuilder.Entity("MyFlib.SkinEntity", b =>
{
b.Property<string>("Name")
.HasMaxLength(254)
.HasColumnType("TEXT");
b.Property<Guid>("ChampionForeignKey")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("TEXT");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid>("ImageId")
.HasColumnType("TEXT");
b.Property<float>("Price")
.HasColumnType("REAL");
b.HasKey("Name");
b.HasIndex("ChampionForeignKey");
b.HasIndex("ImageId");
b.ToTable("Skins");
b.HasData(
new
{
Name = "Akali Infernale",
ChampionForeignKey = new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"),
Description = "Djinn qu'on invoque en dessous du monde, l'Infernale connue sous le nom d'Akali réduira en cendres les ennemis de son maître… mais le prix de son service est toujours exorbitant.",
Icon = "empty",
ImageId = new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"),
Price = 520f
},
new
{
Name = "Akshan Cyberpop",
ChampionForeignKey = new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"),
Description = "Les bas-fonds d'Audio City ont un nouveau héros : le Rebelle fluo. Cette position, Akshan la doit à son courage, sa sagesse et sa capacité à s'infiltrer dans des bâtiments d'affaires hautement sécurisés, et ce, sans être repéré. Son charme ravageur l'a aussi beaucoup aidé.",
Icon = "empty",
ImageId = new Guid("9f9086f5-5cc5-47b5-af9b-a935f4e9b89c"),
Price = 1350f
});
});
modelBuilder.Entity("ChampionEntityRunePageEntity", b =>
{
b.HasOne("MyFlib.ChampionEntity", null)
.WithMany()
.HasForeignKey("ChampionsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("MyFlib.Entities.RunePageEntity", null)
.WithMany()
.HasForeignKey("RunePagesName")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("MyFlib.ChampionEntity", b =>
{
b.HasOne("MyFlib.LargeImageEntity", "Image")
.WithMany()
.HasForeignKey("ImageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Image");
});
modelBuilder.Entity("MyFlib.DictionaryCategoryRune", b =>
{
b.HasOne("MyFlib.RuneEntity", "rune")
.WithMany("DictionaryCategoryRunes")
.HasForeignKey("RuneName")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("MyFlib.Entities.RunePageEntity", "runePage")
.WithMany("DictionaryCategoryRunes")
.HasForeignKey("RunePageName")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("rune");
b.Navigation("runePage");
});
modelBuilder.Entity("MyFlib.Entities.CharacteristicEntity", b =>
{
b.HasOne("MyFlib.ChampionEntity", "Champion")
.WithMany("Characteristics")
.HasForeignKey("ChampionForeignKey")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Champion");
});
modelBuilder.Entity("MyFlib.RuneEntity", b =>
{
b.HasOne("MyFlib.LargeImageEntity", "Image")
.WithMany()
.HasForeignKey("ImageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Image");
});
modelBuilder.Entity("MyFlib.SkillEntity", b =>
{
b.HasOne("MyFlib.ChampionEntity", "Champion")
.WithMany("Skills")
.HasForeignKey("ChampionForeignKey")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Champion");
});
modelBuilder.Entity("MyFlib.SkinEntity", b =>
{
b.HasOne("MyFlib.ChampionEntity", "Champion")
.WithMany("Skins")
.HasForeignKey("ChampionForeignKey")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("MyFlib.LargeImageEntity", "Image")
.WithMany()
.HasForeignKey("ImageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Champion");
b.Navigation("Image");
});
modelBuilder.Entity("MyFlib.ChampionEntity", b =>
{
b.Navigation("Characteristics");
b.Navigation("Skills");
b.Navigation("Skins");
});
modelBuilder.Entity("MyFlib.Entities.RunePageEntity", b =>
{
b.Navigation("DictionaryCategoryRunes");
});
modelBuilder.Entity("MyFlib.RuneEntity", b =>
{
b.Navigation("DictionaryCategoryRunes");
});
#pragma warning restore 612, 618
}
}
}

@ -1,375 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace MyFlib.Migrations
{
/// <inheritdoc />
public partial class myMigration : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "LargeImages",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
Base64 = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_LargeImages", x => x.Id);
});
migrationBuilder.CreateTable(
name: "RunePages",
columns: table => new
{
Name = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_RunePages", x => x.Name);
});
migrationBuilder.CreateTable(
name: "Champions",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false),
Bio = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
Icon = table.Column<string>(type: "TEXT", nullable: false),
Class = table.Column<int>(type: "INTEGER", nullable: false),
ImageId = table.Column<Guid>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Champions", x => x.Id);
table.ForeignKey(
name: "FK_Champions_LargeImages_ImageId",
column: x => x.ImageId,
principalTable: "LargeImages",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Runes",
columns: table => new
{
Name = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false),
Description = table.Column<string>(type: "TEXT", maxLength: 500, nullable: false),
Family = table.Column<int>(type: "INTEGER", nullable: false),
Icon = table.Column<string>(type: "TEXT", nullable: false),
ImageId = table.Column<Guid>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Runes", x => x.Name);
table.ForeignKey(
name: "FK_Runes_LargeImages_ImageId",
column: x => x.ImageId,
principalTable: "LargeImages",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "ChampionEntityRunePageEntity",
columns: table => new
{
ChampionsId = table.Column<Guid>(type: "TEXT", nullable: false),
RunePagesName = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ChampionEntityRunePageEntity", x => new { x.ChampionsId, x.RunePagesName });
table.ForeignKey(
name: "FK_ChampionEntityRunePageEntity_Champions_ChampionsId",
column: x => x.ChampionsId,
principalTable: "Champions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ChampionEntityRunePageEntity_RunePages_RunePagesName",
column: x => x.RunePagesName,
principalTable: "RunePages",
principalColumn: "Name",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Characteristic",
columns: table => new
{
Name = table.Column<string>(type: "TEXT", maxLength: 254, nullable: false),
ChampionForeignKey = table.Column<Guid>(type: "TEXT", nullable: false),
Value = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Characteristic", x => new { x.Name, x.ChampionForeignKey });
table.ForeignKey(
name: "FK_Characteristic_Champions_ChampionForeignKey",
column: x => x.ChampionForeignKey,
principalTable: "Champions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Skills",
columns: table => new
{
Name = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false),
Description = table.Column<string>(type: "TEXT", maxLength: 500, nullable: false),
Type = table.Column<int>(type: "INTEGER", nullable: false),
ChampionForeignKey = table.Column<Guid>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Skills", x => x.Name);
table.ForeignKey(
name: "FK_Skills_Champions_ChampionForeignKey",
column: x => x.ChampionForeignKey,
principalTable: "Champions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Skins",
columns: table => new
{
Name = table.Column<string>(type: "TEXT", maxLength: 254, nullable: false),
Description = table.Column<string>(type: "TEXT", maxLength: 1000, nullable: false),
Icon = table.Column<string>(type: "TEXT", nullable: false),
Price = table.Column<float>(type: "REAL", nullable: false),
ChampionForeignKey = table.Column<Guid>(type: "TEXT", nullable: false),
ImageId = table.Column<Guid>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Skins", x => x.Name);
table.ForeignKey(
name: "FK_Skins_Champions_ChampionForeignKey",
column: x => x.ChampionForeignKey,
principalTable: "Champions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Skins_LargeImages_ImageId",
column: x => x.ImageId,
principalTable: "LargeImages",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "CategoryRunes",
columns: table => new
{
RunePageName = table.Column<string>(type: "TEXT", nullable: false),
RuneName = table.Column<string>(type: "TEXT", nullable: false),
category = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CategoryRunes", x => new { x.RunePageName, x.RuneName });
table.ForeignKey(
name: "FK_CategoryRunes_RunePages_RunePageName",
column: x => x.RunePageName,
principalTable: "RunePages",
principalColumn: "Name",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_CategoryRunes_Runes_RuneName",
column: x => x.RuneName,
principalTable: "Runes",
principalColumn: "Name",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.InsertData(
table: "LargeImages",
columns: new[] { "Id", "Base64" },
values: new object[,]
{
{ new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"), "empty" },
{ new Guid("9f9086f5-5cc5-47b5-af9b-a935f4e9b89c"), " " }
});
migrationBuilder.InsertData(
table: "RunePages",
column: "Name",
values: new object[]
{
"Page 1",
"Page 2"
});
migrationBuilder.InsertData(
table: "Champions",
columns: new[] { "Id", "Bio", "Class", "Icon", "ImageId", "Name" },
values: new object[,]
{
{ new Guid("36ad2a82-d17b-47de-8a95-6e154a7df557"), "", 6, "", new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"), "Alistar" },
{ new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"), "", 4, "", new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"), "Akshan" },
{ new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"), "", 1, "", new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"), "Akali" },
{ new Guid("7f7746fa-b1cb-49da-9409-4b3e6910500e"), "", 5, "", new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"), "Bard" },
{ new Guid("a4f84d92-c20f-4f2d-b3f9-ca00ef556e72"), "", 2, "", new Guid("9f9086f5-5cc5-47b5-af9b-a935f4e9b89c"), "Aatrox" },
{ new Guid("ae5fe535-f041-445e-b570-28b75bc78cb9"), "", 3, "", new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"), "Ahri" }
});
migrationBuilder.InsertData(
table: "Runes",
columns: new[] { "Name", "Description", "Family", "Icon", "ImageId" },
values: new object[,]
{
{ "Hextech Flashtraption ", "While Flash is on cooldown, it is replaced by Hexflash.", 0, "", new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65") },
{ "Manaflow Band ", "Hitting enemy champions with a spell grants 25 maximum mana, up to 250 mana.", 2, "", new Guid("9f9086f5-5cc5-47b5-af9b-a935f4e9b89c") }
});
migrationBuilder.InsertData(
table: "CategoryRunes",
columns: new[] { "RuneName", "RunePageName", "category" },
values: new object[,]
{
{ "Hextech Flashtraption ", "Page 1", 0 },
{ "Manaflow Band ", "Page 1", 1 },
{ "Hextech Flashtraption ", "Page 2", 5 },
{ "Manaflow Band ", "Page 2", 4 }
});
migrationBuilder.InsertData(
table: "Characteristic",
columns: new[] { "ChampionForeignKey", "Name", "Value" },
values: new object[,]
{
{ new Guid("36ad2a82-d17b-47de-8a95-6e154a7df557"), "Ability Power", 0 },
{ new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"), "Ability Power", 0 },
{ new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"), "Ability Power", 0 },
{ new Guid("7f7746fa-b1cb-49da-9409-4b3e6910500e"), "Ability Power", 30 },
{ new Guid("a4f84d92-c20f-4f2d-b3f9-ca00ef556e72"), "Ability Power", 0 },
{ new Guid("ae5fe535-f041-445e-b570-28b75bc78cb9"), "Ability Power", 92 },
{ new Guid("36ad2a82-d17b-47de-8a95-6e154a7df557"), "Attack Damage", 63 },
{ new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"), "Attack Damage", 68 },
{ new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"), "Attack Damage", 56 },
{ new Guid("a4f84d92-c20f-4f2d-b3f9-ca00ef556e72"), "Attack Damage", 70 },
{ new Guid("ae5fe535-f041-445e-b570-28b75bc78cb9"), "Attack Damage", 58 },
{ new Guid("36ad2a82-d17b-47de-8a95-6e154a7df557"), "Attack Speed", 2 },
{ new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"), "Attack Speed", 1 },
{ new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"), "Attack Speed", 1 },
{ new Guid("7f7746fa-b1cb-49da-9409-4b3e6910500e"), "Attack Speed", 1 },
{ new Guid("a4f84d92-c20f-4f2d-b3f9-ca00ef556e72"), "Attack Speed", 1 },
{ new Guid("ae5fe535-f041-445e-b570-28b75bc78cb9"), "Attack Speed", 6 },
{ new Guid("36ad2a82-d17b-47de-8a95-6e154a7df557"), "Health", 573 },
{ new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"), "Health", 570 },
{ new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"), "Health", 575 },
{ new Guid("7f7746fa-b1cb-49da-9409-4b3e6910500e"), "Health", 535 },
{ new Guid("a4f84d92-c20f-4f2d-b3f9-ca00ef556e72"), "Health", 580 },
{ new Guid("ae5fe535-f041-445e-b570-28b75bc78cb9"), "Health", 526 },
{ new Guid("36ad2a82-d17b-47de-8a95-6e154a7df557"), "Mana", 278 },
{ new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"), "Mana", 350 },
{ new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"), "Mana", 200 },
{ new Guid("7f7746fa-b1cb-49da-9409-4b3e6910500e"), "Mana", 350 },
{ new Guid("a4f84d92-c20f-4f2d-b3f9-ca00ef556e72"), "Mana", 0 },
{ new Guid("ae5fe535-f041-445e-b570-28b75bc78cb9"), "Mana", 418 }
});
migrationBuilder.InsertData(
table: "Skills",
columns: new[] { "Name", "ChampionForeignKey", "Description", "Type" },
values: new object[,]
{
{ "Boule de feu", new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"), "Fire!", 1 },
{ "White Star", new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"), "Random damage", 3 }
});
migrationBuilder.InsertData(
table: "Skins",
columns: new[] { "Name", "ChampionForeignKey", "Description", "Icon", "ImageId", "Price" },
values: new object[,]
{
{ "Akali Infernale", new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"), "Djinn qu'on invoque en dessous du monde, l'Infernale connue sous le nom d'Akali réduira en cendres les ennemis de son maître… mais le prix de son service est toujours exorbitant.", "empty", new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"), 520f },
{ "Akshan Cyberpop", new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"), "Les bas-fonds d'Audio City ont un nouveau héros : le Rebelle fluo. Cette position, Akshan la doit à son courage, sa sagesse et sa capacité à s'infiltrer dans des bâtiments d'affaires hautement sécurisés, et ce, sans être repéré. Son charme ravageur l'a aussi beaucoup aidé.", "empty", new Guid("9f9086f5-5cc5-47b5-af9b-a935f4e9b89c"), 1350f }
});
migrationBuilder.CreateIndex(
name: "IX_CategoryRunes_RuneName",
table: "CategoryRunes",
column: "RuneName");
migrationBuilder.CreateIndex(
name: "IX_ChampionEntityRunePageEntity_RunePagesName",
table: "ChampionEntityRunePageEntity",
column: "RunePagesName");
migrationBuilder.CreateIndex(
name: "IX_Champions_ImageId",
table: "Champions",
column: "ImageId");
migrationBuilder.CreateIndex(
name: "IX_Characteristic_ChampionForeignKey",
table: "Characteristic",
column: "ChampionForeignKey");
migrationBuilder.CreateIndex(
name: "IX_Runes_ImageId",
table: "Runes",
column: "ImageId");
migrationBuilder.CreateIndex(
name: "IX_Skills_ChampionForeignKey",
table: "Skills",
column: "ChampionForeignKey");
migrationBuilder.CreateIndex(
name: "IX_Skins_ChampionForeignKey",
table: "Skins",
column: "ChampionForeignKey");
migrationBuilder.CreateIndex(
name: "IX_Skins_ImageId",
table: "Skins",
column: "ImageId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CategoryRunes");
migrationBuilder.DropTable(
name: "ChampionEntityRunePageEntity");
migrationBuilder.DropTable(
name: "Characteristic");
migrationBuilder.DropTable(
name: "Skills");
migrationBuilder.DropTable(
name: "Skins");
migrationBuilder.DropTable(
name: "Runes");
migrationBuilder.DropTable(
name: "RunePages");
migrationBuilder.DropTable(
name: "Champions");
migrationBuilder.DropTable(
name: "LargeImages");
}
}
}

@ -1,668 +0,0 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using MyFlib;
#nullable disable
namespace MyFlib.Migrations
{
[DbContext(typeof(LolDbContext))]
partial class LolDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.2");
modelBuilder.Entity("ChampionEntityRunePageEntity", b =>
{
b.Property<Guid>("ChampionsId")
.HasColumnType("TEXT");
b.Property<string>("RunePagesName")
.HasColumnType("TEXT");
b.HasKey("ChampionsId", "RunePagesName");
b.HasIndex("RunePagesName");
b.ToTable("ChampionEntityRunePageEntity");
});
modelBuilder.Entity("MyFlib.ChampionEntity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Bio")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<int>("Class")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid>("ImageId")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ImageId");
b.ToTable("Champions");
b.HasData(
new
{
Id = new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"),
Bio = "",
Class = 1,
Icon = "",
ImageId = new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"),
Name = "Akali"
},
new
{
Id = new Guid("a4f84d92-c20f-4f2d-b3f9-ca00ef556e72"),
Bio = "",
Class = 2,
Icon = "",
ImageId = new Guid("9f9086f5-5cc5-47b5-af9b-a935f4e9b89c"),
Name = "Aatrox"
},
new
{
Id = new Guid("ae5fe535-f041-445e-b570-28b75bc78cb9"),
Bio = "",
Class = 3,
Icon = "",
ImageId = new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"),
Name = "Ahri"
},
new
{
Id = new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"),
Bio = "",
Class = 4,
Icon = "",
ImageId = new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"),
Name = "Akshan"
},
new
{
Id = new Guid("7f7746fa-b1cb-49da-9409-4b3e6910500e"),
Bio = "",
Class = 5,
Icon = "",
ImageId = new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"),
Name = "Bard"
},
new
{
Id = new Guid("36ad2a82-d17b-47de-8a95-6e154a7df557"),
Bio = "",
Class = 6,
Icon = "",
ImageId = new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"),
Name = "Alistar"
});
});
modelBuilder.Entity("MyFlib.DictionaryCategoryRune", b =>
{
b.Property<string>("RunePageName")
.HasColumnType("TEXT");
b.Property<string>("RuneName")
.HasColumnType("TEXT");
b.Property<int>("category")
.HasColumnType("INTEGER");
b.HasKey("RunePageName", "RuneName");
b.HasIndex("RuneName");
b.ToTable("CategoryRunes");
b.HasData(
new
{
RunePageName = "Page 1",
RuneName = "Hextech Flashtraption ",
category = 0
},
new
{
RunePageName = "Page 1",
RuneName = "Manaflow Band ",
category = 1
},
new
{
RunePageName = "Page 2",
RuneName = "Manaflow Band ",
category = 4
},
new
{
RunePageName = "Page 2",
RuneName = "Hextech Flashtraption ",
category = 5
});
});
modelBuilder.Entity("MyFlib.Entities.CharacteristicEntity", b =>
{
b.Property<string>("Name")
.HasMaxLength(254)
.HasColumnType("TEXT");
b.Property<Guid>("ChampionForeignKey")
.HasColumnType("TEXT");
b.Property<int>("Value")
.HasColumnType("INTEGER");
b.HasKey("Name", "ChampionForeignKey");
b.HasIndex("ChampionForeignKey");
b.ToTable("Characteristic");
b.HasData(
new
{
Name = "Attack Damage",
ChampionForeignKey = new Guid("ae5fe535-f041-445e-b570-28b75bc78cb9"),
Value = 58
},
new
{
Name = "Ability Power",
ChampionForeignKey = new Guid("ae5fe535-f041-445e-b570-28b75bc78cb9"),
Value = 92
},
new
{
Name = "Attack Speed",
ChampionForeignKey = new Guid("ae5fe535-f041-445e-b570-28b75bc78cb9"),
Value = 6
},
new
{
Name = "Health",
ChampionForeignKey = new Guid("ae5fe535-f041-445e-b570-28b75bc78cb9"),
Value = 526
},
new
{
Name = "Mana",
ChampionForeignKey = new Guid("ae5fe535-f041-445e-b570-28b75bc78cb9"),
Value = 418
},
new
{
Name = "Attack Damage",
ChampionForeignKey = new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"),
Value = 68
},
new
{
Name = "Ability Power",
ChampionForeignKey = new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"),
Value = 0
},
new
{
Name = "Attack Speed",
ChampionForeignKey = new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"),
Value = 1
},
new
{
Name = "Health",
ChampionForeignKey = new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"),
Value = 570
},
new
{
Name = "Mana",
ChampionForeignKey = new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"),
Value = 350
},
new
{
Name = "Attack Damage",
ChampionForeignKey = new Guid("a4f84d92-c20f-4f2d-b3f9-ca00ef556e72"),
Value = 70
},
new
{
Name = "Ability Power",
ChampionForeignKey = new Guid("a4f84d92-c20f-4f2d-b3f9-ca00ef556e72"),
Value = 0
},
new
{
Name = "Attack Speed",
ChampionForeignKey = new Guid("a4f84d92-c20f-4f2d-b3f9-ca00ef556e72"),
Value = 1
},
new
{
Name = "Health",
ChampionForeignKey = new Guid("a4f84d92-c20f-4f2d-b3f9-ca00ef556e72"),
Value = 580
},
new
{
Name = "Mana",
ChampionForeignKey = new Guid("a4f84d92-c20f-4f2d-b3f9-ca00ef556e72"),
Value = 0
},
new
{
Name = "Attack Damage",
ChampionForeignKey = new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"),
Value = 56
},
new
{
Name = "Ability Power",
ChampionForeignKey = new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"),
Value = 0
},
new
{
Name = "Attack Speed",
ChampionForeignKey = new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"),
Value = 1
},
new
{
Name = "Health",
ChampionForeignKey = new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"),
Value = 575
},
new
{
Name = "Mana",
ChampionForeignKey = new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"),
Value = 200
},
new
{
Name = "Attack Damage",
ChampionForeignKey = new Guid("36ad2a82-d17b-47de-8a95-6e154a7df557"),
Value = 63
},
new
{
Name = "Ability Power",
ChampionForeignKey = new Guid("36ad2a82-d17b-47de-8a95-6e154a7df557"),
Value = 0
},
new
{
Name = "Attack Speed",
ChampionForeignKey = new Guid("36ad2a82-d17b-47de-8a95-6e154a7df557"),
Value = 2
},
new
{
Name = "Health",
ChampionForeignKey = new Guid("36ad2a82-d17b-47de-8a95-6e154a7df557"),
Value = 573
},
new
{
Name = "Mana",
ChampionForeignKey = new Guid("36ad2a82-d17b-47de-8a95-6e154a7df557"),
Value = 278
},
new
{
Name = "Ability Power",
ChampionForeignKey = new Guid("7f7746fa-b1cb-49da-9409-4b3e6910500e"),
Value = 30
},
new
{
Name = "Attack Speed",
ChampionForeignKey = new Guid("7f7746fa-b1cb-49da-9409-4b3e6910500e"),
Value = 1
},
new
{
Name = "Health",
ChampionForeignKey = new Guid("7f7746fa-b1cb-49da-9409-4b3e6910500e"),
Value = 535
},
new
{
Name = "Mana",
ChampionForeignKey = new Guid("7f7746fa-b1cb-49da-9409-4b3e6910500e"),
Value = 350
});
});
modelBuilder.Entity("MyFlib.Entities.RunePageEntity", b =>
{
b.Property<string>("Name")
.HasMaxLength(64)
.HasColumnType("TEXT");
b.HasKey("Name");
b.ToTable("RunePages");
b.HasData(
new
{
Name = "Page 1"
},
new
{
Name = "Page 2"
});
});
modelBuilder.Entity("MyFlib.LargeImageEntity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Base64")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("LargeImages");
b.HasData(
new
{
Id = new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"),
Base64 = "empty"
},
new
{
Id = new Guid("9f9086f5-5cc5-47b5-af9b-a935f4e9b89c"),
Base64 = " "
});
});
modelBuilder.Entity("MyFlib.RuneEntity", b =>
{
b.Property<string>("Name")
.HasMaxLength(64)
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT");
b.Property<int>("Family")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid>("ImageId")
.HasColumnType("TEXT");
b.HasKey("Name");
b.HasIndex("ImageId");
b.ToTable("Runes");
b.HasData(
new
{
Name = "Hextech Flashtraption ",
Description = "While Flash is on cooldown, it is replaced by Hexflash.",
Family = 0,
Icon = "",
ImageId = new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65")
},
new
{
Name = "Manaflow Band ",
Description = "Hitting enemy champions with a spell grants 25 maximum mana, up to 250 mana.",
Family = 2,
Icon = "",
ImageId = new Guid("9f9086f5-5cc5-47b5-af9b-a935f4e9b89c")
});
});
modelBuilder.Entity("MyFlib.SkillEntity", b =>
{
b.Property<string>("Name")
.HasMaxLength(64)
.HasColumnType("TEXT");
b.Property<Guid>("ChampionForeignKey")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.HasKey("Name");
b.HasIndex("ChampionForeignKey");
b.ToTable("Skills");
b.HasData(
new
{
Name = "Boule de feu",
ChampionForeignKey = new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"),
Description = "Fire!",
Type = 1
},
new
{
Name = "White Star",
ChampionForeignKey = new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"),
Description = "Random damage",
Type = 3
});
});
modelBuilder.Entity("MyFlib.SkinEntity", b =>
{
b.Property<string>("Name")
.HasMaxLength(254)
.HasColumnType("TEXT");
b.Property<Guid>("ChampionForeignKey")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("TEXT");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid>("ImageId")
.HasColumnType("TEXT");
b.Property<float>("Price")
.HasColumnType("REAL");
b.HasKey("Name");
b.HasIndex("ChampionForeignKey");
b.HasIndex("ImageId");
b.ToTable("Skins");
b.HasData(
new
{
Name = "Akali Infernale",
ChampionForeignKey = new Guid("4422c524-b2cb-43ef-8263-990c3cea7cae"),
Description = "Djinn qu'on invoque en dessous du monde, l'Infernale connue sous le nom d'Akali réduira en cendres les ennemis de son maître… mais le prix de son service est toujours exorbitant.",
Icon = "empty",
ImageId = new Guid("8d121cdc-6787-4738-8edd-9e026ac16b65"),
Price = 520f
},
new
{
Name = "Akshan Cyberpop",
ChampionForeignKey = new Guid("3708dcfd-02a1-491e-b4f7-e75bf274cf23"),
Description = "Les bas-fonds d'Audio City ont un nouveau héros : le Rebelle fluo. Cette position, Akshan la doit à son courage, sa sagesse et sa capacité à s'infiltrer dans des bâtiments d'affaires hautement sécurisés, et ce, sans être repéré. Son charme ravageur l'a aussi beaucoup aidé.",
Icon = "empty",
ImageId = new Guid("9f9086f5-5cc5-47b5-af9b-a935f4e9b89c"),
Price = 1350f
});
});
modelBuilder.Entity("ChampionEntityRunePageEntity", b =>
{
b.HasOne("MyFlib.ChampionEntity", null)
.WithMany()
.HasForeignKey("ChampionsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("MyFlib.Entities.RunePageEntity", null)
.WithMany()
.HasForeignKey("RunePagesName")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("MyFlib.ChampionEntity", b =>
{
b.HasOne("MyFlib.LargeImageEntity", "Image")
.WithMany()
.HasForeignKey("ImageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Image");
});
modelBuilder.Entity("MyFlib.DictionaryCategoryRune", b =>
{
b.HasOne("MyFlib.RuneEntity", "rune")
.WithMany("DictionaryCategoryRunes")
.HasForeignKey("RuneName")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("MyFlib.Entities.RunePageEntity", "runePage")
.WithMany("DictionaryCategoryRunes")
.HasForeignKey("RunePageName")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("rune");
b.Navigation("runePage");
});
modelBuilder.Entity("MyFlib.Entities.CharacteristicEntity", b =>
{
b.HasOne("MyFlib.ChampionEntity", "Champion")
.WithMany("Characteristics")
.HasForeignKey("ChampionForeignKey")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Champion");
});
modelBuilder.Entity("MyFlib.RuneEntity", b =>
{
b.HasOne("MyFlib.LargeImageEntity", "Image")
.WithMany()
.HasForeignKey("ImageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Image");
});
modelBuilder.Entity("MyFlib.SkillEntity", b =>
{
b.HasOne("MyFlib.ChampionEntity", "Champion")
.WithMany("Skills")
.HasForeignKey("ChampionForeignKey")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Champion");
});
modelBuilder.Entity("MyFlib.SkinEntity", b =>
{
b.HasOne("MyFlib.ChampionEntity", "Champion")
.WithMany("Skins")
.HasForeignKey("ChampionForeignKey")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("MyFlib.LargeImageEntity", "Image")
.WithMany()
.HasForeignKey("ImageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Champion");
b.Navigation("Image");
});
modelBuilder.Entity("MyFlib.ChampionEntity", b =>
{
b.Navigation("Characteristics");
b.Navigation("Skills");
b.Navigation("Skins");
});
modelBuilder.Entity("MyFlib.Entities.RunePageEntity", b =>
{
b.Navigation("DictionaryCategoryRunes");
});
modelBuilder.Entity("MyFlib.RuneEntity", b =>
{
b.Navigation("DictionaryCategoryRunes");
});
#pragma warning restore 612, 618
}
}
}
Loading…
Cancel
Save