Compare commits

..

No commits in common. 'master' and 'MAUI_Settings' have entirely different histories.

@ -1,6 +1,6 @@
kind: pipeline
type: docker
name: LolProject
name: default
trigger:
event:
@ -31,7 +31,7 @@ steps:
commands:
- cd src/EntityFramework_LoL/Sources/
- dotnet restore LeagueOfLegendsCI.sln
- dotnet sonarscanner begin /k:LolProjectIUT /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="Tests/**,DbManager/**,Client/**" /d:sonar.login=$${PLUGIN_SONAR_TOKEN}
- dotnet sonarscanner begin /k:LolProjectIUT /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="Tests/**" /d:sonar.login=$${PLUGIN_SONAR_TOKEN}
- dotnet build LeagueOfLegendsCI.sln -c Release --no-restore
- dotnet test LeagueOfLegendsCI.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage"
- reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport"

Binary file not shown.

@ -21,7 +21,7 @@
</div>
**Thème du projet** : Réalisation d'une API Rest Full et d'un ORM (Entity Framework) qui seront reliés à une base de données (SQLite) dans le thème de League of Legends <img src="https://logo-marque.com/wp-content/uploads/2020/11/League-of-Legends-Embleme.png" width="40" >
**Thème du projet** : Réalisation d'une API et d'un ORM (Entity Framework) qui seront reliés à une base de données (SQLite) dans le thème de League of Legends <img src="https://logo-marque.com/wp-content/uploads/2020/11/League-of-Legends-Embleme.png" width="40" >
</br>
<img src="doc/Images/Title-Répartition.png" width="400">
@ -37,12 +37,58 @@
👉 [**Solution de l'application pour la CI**](src/EntityFramework_LoL/Sources/LeagueOfLegendsCI.sln)
- ### Avancement du projet :construction_worker:
<u>Où en suis-je</u>:grey_question::grey_exclamation: (:white_check_mark: réalisé, :warning: presque abouti, :x: non commencé )
Côté API :
- :white_check_mark: [**Partie 1**](src/EntityFramework_Lol/Sources/ApiLol/Controllers) : **Mise en place de toutes les opérations CRUD**
- :white_check_mark: [**Partie 2**](src/EntityFramework_Lol/Sources/ApiLol/Controllers) : **Respect des règles de routage, utilisation des bons status code**
- :white_check_mark: [**Partie 3**](src/EntityFramework_Lol/Sources/ApiLol/Controllers) : **Versionnage de l'api**
- :white_check_mark: [**Partie 4**](src/EntityFramework_Lol/Sources/Tests/ApiTests) : **Tests unitaires**
- :white_check_mark: [**Partie 5**](.drone.yml) : **Dockerisation et Hébergement de l'API**
- :white_check_mark: [**Partie 6**](src/EntityFramework_Lol/Sources/ApiLol/Controllers) : **Logs**
- :white_check_mark: [**Partie 7**](src/EntityFramework_Lol/Sources/ApiLol/Controllers) : **Filtrage + Pagination des données**
- :x: [**Partie 8**](src/EntityFramework_Lol/Sources/ApiLol/) : **Utilisation des fichiers configurations**
- :x: [**Partie 9**](src/EntityFramework_Lol/Sources/) : **Réalisation du client MAUI et liaison avec l'api**
- :x: [**Partie 10**](src/EntityFramework_Lol/Sources/ApiLol/) : **Liaison avec la base de données**
Côté Entity_Framework :
- :white_check_mark: [**Partie 1**](src/EntityFramework_Lol/Sources/MyFlib/Entities) : **Réalisation des Entities**
- :white_check_mark: [**Partie 2**](src/EntityFramework_Lol/Sources/MyFlib/DataSeeder.cs) : **Data seeder**
- :white_check_mark: [**Partie 3**](src/EntityFramework_Lol/Sources/Tests/UT_EF) : **Tests unitaires**
- :white_check_mark: [**Partie 4**](src/EntityFramework_Lol/Sources/MyFlib) : **Many to many**
- :warning: [**Partie 5**](src/EntityFramework_Lol/Sources/) : **DbManager**
- :warning: [**Partie 6**](src/EntityFramework_Lol/Sources/) : **Mapping**
Autre :
- :white_check_mark: [**Partie 1**](.drone.yml) : **Mise en place de SonarQube**
- :white_check_mark: [**Partie 2**](.drone.yml) : **Schéma et description de l'architecture globale de l'application**
<img src="doc/Images/Title-Fonctionnement.png" width="460" >
- ### :building_construction: Comment est structurée l'architecture globale de l'application ?
Voici un **schéma** pour mieux représenter mon architecture :
Voici un **schéma** pour mieux représenter mon architecture :
<img src="doc/Schémas/Architecture_Global.png" width="1000" >
@ -57,7 +103,7 @@ La web API est chargée de transformer les classes métiers du modèle en DTO (D
Grâce à l'injection de dépendances dans le projet, la Web API n'a pas besoin d'être modifiée lorsqu'on veut passer du StubLib au DbManager (si vous ne savez pas ce que c'est, je vous invite à voir cette vidéo qui explique très clairement l'[Injection de dépendances](https://www.youtube.com/watch?v=OeWgBNR1BLU&t=10s&ab_channel=BaptisteMobileDev)).
La partie ```bases de données``` est gérée par le DbManager, qui utilise l'ORM Entity Framework (plus précisément le DbContext) pour récupérer les données dans la base de données. De plus, grâce à une factory :factory: (oui, comme celle de la web API), elle transforme les données en tables (appelées "Entities") en classes du modèle (et inversement).
La partie **bases de données** est gérée par le DbManager, qui utilise l'ORM Entity Framework (plus précisément le DbContext) pour récupérer les données dans la base de données. De plus, grâce à une factory :factory: (oui, comme celle de la web API), elle transforme les données en tables (appelées "Entities") en classes du modèle.
Le client MAUI pourra effectuer des requêtes HTTP à l'API via l'API Manager, qui hérite de IDataManager et possède une liste de fonctions responsables d'exécuter les requêtes. De cette manière, le client n'aura pas besoin de connaître l'API pour interagir avec elle. :bulb:
@ -84,7 +130,7 @@ Vous pouvez le cloner via un terminal dans le répertoire de votre choix en util
- ### Comment lancer l'API dotnet :question:
Pour pouvoir utiliser toutes les requêtes de l'API, il est nécessaire de récupérer le projet si cela n'a pas été fait, puis de le lancer à partir de Visual Studio. Vous pouvez directement cliquer sur la solution du projet. Ensuite, dans les projets de démarrage, choisissez **Api-Lol** :
Pour pouvoir utiliser toutes les requêtes de l'API, il est nécessaire de récupérer le projet si cela n'a pas été fait, puis de le lancer à partir de Visual Studio. Vous pouvez directement cliquer sur la solution du projet. Ensuite, dans les projets de démarrage, choisissez "Api-Lol" :
<div align = center>
@ -92,7 +138,7 @@ Pour pouvoir utiliser toutes les requêtes de l'API, il est nécessaire de récu
</div>
Normalement, tout est bon et vous serez redirigé vers Swagger, qui est l'interface graphique permettant d'effectuer facilement des requêtes. Il vous suffit ensuite de choisir la version en haut à droite. La ```version 2.0``` est normalement la plus récente et la plus performante en termes de gestion d'erreur :
Normalement, tout est bon et vous serez redirigé vers Swagger, qui est l'interface graphique permettant d'effectuer facilement des requêtes. Il vous suffit ensuite de choisir la version en haut à droite. La version 3.0 est normalement la plus récente et la plus performante en termes de gestion d'erreur :
<div align = center>
@ -114,11 +160,11 @@ Assurez-vous également d'avoir installé les packages Nuget suivants sur Visual
</div>
Ensuite, sur le terminal PowerShell ou Visual Studio, lancer la migration via la commande : **dotnet ef migrations add monNomDeMigration** (n'oubliez pas de vous situer dans le dossier **/MyFlib** lorsque vous l'exécutez)!
Ensuite, sur le terminal PowerShell ou Visual Studio, lancer la migration via la commande : **dotnet ef migrations add monNomDeMigration** (n'oubliez pas de vous situer dans le dossier "/MyFlib" lorsque vous l'exécutez)!
- ### Comment voir la base de données ?
```C'est bien beau toutes ces étapes, mais sil n'y a pas de résultat, à quoi cela sert !```
C'est bien beau toutes ces étapes, mais sil n'y a pas de résultat, à quoi cela sert !
Tout d'abord, veuillez regarder dans l'onglet Extensions si l'outil **SQLite and SQL Server Compact Toolbax** est bien installé.
@ -149,14 +195,6 @@ 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.
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>
<div align = center>
@ -175,69 +213,7 @@ Pour accomplir cela, veuillez configurer les propriétés de la solution en cliq
Vous pouvez vous amuser à filtrer les champions sur cette page, visualiser leurs skins, les modifier, et même en ajouter ! :grin:
:information_source: *Pour utiliser cette application, vous devez avoir la dernière version de Visual Studio, avoir effectué la migration auparavant (comme indiqué ci-dessus), et avoir sélectionné la solution **LeagueOfLegends** plutôt que **LeagueOfLegendsCi**. Si vous avez besoin d'aide ou si vous souhaitez obtenir plus d'informations, vous pouvez contacter le technicien responsable de l'application (c'est-à-dire moi), en vous référant à mon mail ci-dessous. :email: Notez également qu'il est capable de lancer l'application soit à partir de votre téléphone Android, soit via un émulateur !*
- ### Tests Unitaires :triangular_flag_on_post:
Afin de garantir un code de qualité avec le moins d'erreurs possible, j'ai pris soin de réaliser des tests unitaires tout au long de ce projet à l'aide de la bibliothèque **XUnit**. J'ai ensuite intégré ces tests à mon processus d'intégration continue (CI) via l'outil ```Drone```, ce qui m'a permis de détecter rapidement toute erreur ou anomalie tout au long du projet. L'utilisation de tests unitaires et d'une intégration continue a été essentielle pour garantir la qualité du code, améliorer la maintenabilité et réduire le temps nécessaire pour détecter et corriger les erreurs.:bug:
Toute la partie EF et API a été testée correctement. Cependant, le DbManager et l'ApiManager qui les utilisent n'ont pas été testés et ont été retirés de la couverture de code sur **SonarQube**. Voici la couverture de code actuelle de chaque partie (le 26/03/23) :
<div align = center>
![Couverture de code](doc/Images/Tests-Coverage.png)
</div>
:information_source: *La partie API a été testée uniquement pour vérifier le bon fonctionnement de ses mécanismes de base. Cependant, je n'ai pas réalisé de tests pour vérifier les scénarios d'erreur possibles qui pourraient survenir lors de l'exécution de ces fonctions. De plus, la partie modèle et la bibliothèque Stublib ont été testées simultanément avec l'API.*
- ### Avancement du projet :construction_worker:
<u>Où en suis-je</u>:grey_question::grey_exclamation: (:white_check_mark: réalisé, :warning: presque abouti, :x: non commencé )
Côté API :
- :white_check_mark: [**Partie 1**](src/EntityFramework_Lol/Sources/ApiLol/Controllers) : **Mise en place de toutes les opérations CRUD**
- :white_check_mark: [**Partie 2**](src/EntityFramework_Lol/Sources/ApiLol/Controllers) : **Respect des règles de routage, utilisation des bons status code**
- :white_check_mark: [**Partie 3**](src/EntityFramework_Lol/Sources/ApiLol/Controllers) : **Versionnage de l'api**
- :white_check_mark: [**Partie 4**](src/EntityFramework_Lol/Sources/Tests/ApiTests) : **Tests unitaires**
- :white_check_mark: [**Partie 5**](.drone.yml) : **Dockerisation et Hébergement de l'API**
- :white_check_mark: [**Partie 6**](src/EntityFramework_Lol/Sources/ApiLol/Controllers) : **Logs**
- :white_check_mark: [**Partie 7**](src/EntityFramework_Lol/Sources/ApiLol/Controllers) : **Filtrage + Pagination des données**
- :x: [**Partie 8**](src/EntityFramework_Lol/Sources/ApiLol/) : **Utilisation des fichiers configurations**
- :warning: [**Partie 9**](src/EntityFramework_Lol/Sources/) : **Réalisation du client MAUI et liaison avec l'api**
- :white_check_mark: [**Partie 10**](src/EntityFramework_Lol/Sources/ApiLol/) : **Liaison avec la base de données**
Côté Entity_Framework :
- :white_check_mark: [**Partie 1**](src/EntityFramework_Lol/Sources/MyFlib/Entities) : **Réalisation des Entities**
- :white_check_mark: [**Partie 2**](src/EntityFramework_Lol/Sources/MyFlib/DataSeeder.cs) : **Data seeder**
- :white_check_mark: [**Partie 3**](src/EntityFramework_Lol/Sources/Tests/UT_EF) : **Tests unitaires**
- :white_check_mark: [**Partie 4**](src/EntityFramework_Lol/Sources/MyFlib) : **Many to many**
- :white_check_mark: [**Partie 5**](src/EntityFramework_Lol/Sources/) : **DbManager**
- :white_check_mark: [**Partie 6**](src/EntityFramework_Lol/Sources/) : **Mapping**
Autre :
- :white_check_mark: [**Partie 1**](.drone.yml) : **Mise en place de SonarQube**
- :white_check_mark: [**Partie 2**](.drone.yml) : **Schéma et description de l'architecture globale de l'application**
:information_source: *Pour utiliser cette application, vous devez avoir la dernière version de Visual Studio, avoir effectué la migration auparavant (comme indiqué ci-dessus), et avoir sélectionné la solution **LeagueOfLegends** plutôt que **LeagueOfLegendsCi**. Si vous avez besoin d'aide ou si vous souhaitez obtenir plus d'informations, vous pouvez contacter le technicien responsable de l'application (c'est-à-dire moi), en vous référant à mon mail ci-dessous. :email:*
<img src="doc/Images/Title-Environnement.png" width="400" >

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 KiB

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

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

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

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

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

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

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

@ -1,23 +1,22 @@
using ApiMapping;
using ApiMapping.enums;
using DTO;
using Model;
namespace ApiMapping
{
public static class RuneMapper
{
public static RuneDto ToDto(this Rune rune)
=> new()
{
Name = rune.Name,
Description = rune.Description,
Family = rune.Family.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);
}
}
using ApiLol.Mapper.enums;
using DTO;
using Model;
namespace ApiLol.Mapper
{
public static class RuneMapper
{
public static RuneDto ToDto(this Rune rune)
=> new()
{
Name = rune.Name,
Description = rune.Description,
Family = rune.Family.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);
}
}

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

@ -1,21 +1,19 @@
using ApiMapping;
using ApiMapping.enums;
using DTO;
using Model;
namespace ApiMapping
{
public static class SkillMapper
{
public static SkillDto ToDto(this Skill skill)
=> new()
{
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);
}
}
using DTO;
using Model;
namespace ApiLol.Mapper
{
public static class SkillMapper
{
public static SkillDto ToDto(this Skill skill)
=> new()
{
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);
}
}

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

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

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

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

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

@ -1,6 +1,5 @@
using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.AspNetCore.Mvc.Versioning;
using Microsoft.OpenApi.Models;
using Model;
var builder = WebApplication.CreateBuilder(args);
@ -10,11 +9,7 @@ var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen(options =>
{
options.SwaggerDoc("v1", new OpenApiInfo { Title = "My API v1", Version = "v1" });
options.SwaggerDoc("v2", new OpenApiInfo { Title = "My API v2", Version = "v2" });
});
builder.Services.AddSwaggerGen();
builder.Services.AddApiVersioning(opt =>

@ -1,184 +0,0 @@
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;
}
}
}
}
}

@ -1,145 +0,0 @@
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;
}
}
}
}
}

@ -1,138 +0,0 @@
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;
}
}
}
}
}

@ -1,178 +0,0 @@
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 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\ApiMapping\ApiMapping.csproj" />
<ProjectReference Include="..\DTO\DTO.csproj" />
<ProjectReference Include="..\Model\Model.csproj" />
</ItemGroup>
</Project>

@ -1,24 +0,0 @@
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; }
}
}

@ -0,0 +1,42 @@
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}";
return await _httpClient.GetFromJsonAsync<IEnumerable<ChampionDto>>(url);
}
/* 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);
}*/
}
}

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

@ -1,33 +0,0 @@
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)));
}
}
}

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

@ -47,12 +47,9 @@ namespace DbLib
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)
{
parent.DbContext.Runes.Include(r => r.Image);
return parent.DbContext.RunePages.Include(rp => rp.Champions).Include(rp => rp.DictionaryCategoryRunes).Include(rp => rp.DictionaryCategoryRunes).GetItemsWithFilterAndOrdering(
=> parent.DbContext.RunePages.Include(rp => rp.Champions).Include(rp => rp.DictionaryCategoryRunes).GetItemsWithFilterAndOrdering(
rp => true,
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)
=> parent.DbContext.RunePages.Include(rp => rp.Champions).Include(rp => rp.DictionaryCategoryRunes).GetItemsWithFilterAndOrdering(

@ -1,5 +1,4 @@
using DbManager.Mapper;
using Microsoft.EntityFrameworkCore;
using Model;
namespace DbLib
@ -41,22 +40,22 @@ namespace DbLib
= (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)
=> parent.DbContext.Runes.Include(r => r.Image).GetItemsWithFilterAndOrdering(
=> parent.DbContext.Runes.GetItemsWithFilterAndOrdering(
rune => filterByName(rune.ToModel(), substring),
index, count, orderingPropertyName, descending).Select(c => c.ToModel());
public async Task<IEnumerable<Rune?>> GetItems(int index, int count, string? orderingPropertyName = null, bool descending = false)
=> parent.DbContext.Runes.Include(r => r.Image).GetItemsWithFilterAndOrdering(
=> parent.DbContext.Runes.GetItemsWithFilterAndOrdering(
r => true,
index, count, orderingPropertyName, descending).Select(c => c.ToModel());
public async Task<IEnumerable<Rune?>> GetItemsByFamily(RuneFamily family, int index, int count, string? orderingPropertyName = null, bool descending = false)
=> parent.DbContext.Runes.Include(r => r.Image).GetItemsWithFilterAndOrdering(
=> parent.DbContext.Runes.GetItemsWithFilterAndOrdering(
rune => filterByRuneFamily(rune.ToModel(), family),
index, count, orderingPropertyName, descending).Select(c => c.ToModel());
public async Task<IEnumerable<Rune?>> GetItemsByName(string substring, int index, int count, string? orderingPropertyName = null, bool descending = false)
=> parent.DbContext.Runes.Include(r => r.Image).GetItemsWithFilterAndOrdering(
=> parent.DbContext.Runes.GetItemsWithFilterAndOrdering(
rune => filterByNameContains(rune.ToModel(), substring),
index, count, orderingPropertyName, descending).Select(c => c.ToModel());

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

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

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

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

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

@ -21,7 +21,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DTO", "DTO\DTO.csproj", "{3
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApiTests", "Tests\ApiTests\ApiTests.csproj", "{1779D8A4-2E12-47F3-BDA2-2E7F04B758EB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApiManager", "Client\ApiManager.csproj", "{464DAB04-BE65-429D-9A39-3E1BB43C521A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Client", "Client\Client.csproj", "{464DAB04-BE65-429D-9A39-3E1BB43C521A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyFlib", "MyFlib\MyFlib.csproj", "{2142AB69-B483-4B0A-96DC-CFA87DEB11A5}"
EndProject
@ -33,8 +33,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LolApp", "LolApp\LolApp.csp
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ViewModels", "ViewModels\ViewModels.csproj", "{65135247-E1AB-4EE4-9473-DFDE6AFCC250}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiMapping", "ApiMapping\ApiMapping.csproj", "{F8D44A32-788B-4E63-B379-278B90216E28}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -95,10 +93,6 @@ Global
{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.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
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

@ -21,14 +21,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DTO", "DTO\DTO.csproj", "{3
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApiTests", "Tests\ApiTests\ApiTests.csproj", "{1779D8A4-2E12-47F3-BDA2-2E7F04B758EB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Client", "Client\Client.csproj", "{464DAB04-BE65-429D-9A39-3E1BB43C521A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyFlib", "MyFlib\MyFlib.csproj", "{2142AB69-B483-4B0A-96DC-CFA87DEB11A5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UT_EF", "Tests\UT_EF\UT_EF.csproj", "{F896C30B-A6FE-42B2-BAC8-08360BC48DC6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DbManager", "DbManager\DbManager.csproj", "{71DDCC06-D993-47B0-92E3-5DD6E295FB8B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApiManager", "Client\ApiManager.csproj", "{1903905B-13B3-4DA2-94E2-917F39588032}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -63,6 +63,10 @@ Global
{1779D8A4-2E12-47F3-BDA2-2E7F04B758EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1779D8A4-2E12-47F3-BDA2-2E7F04B758EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1779D8A4-2E12-47F3-BDA2-2E7F04B758EB}.Release|Any CPU.Build.0 = Release|Any CPU
{464DAB04-BE65-429D-9A39-3E1BB43C521A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{464DAB04-BE65-429D-9A39-3E1BB43C521A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{464DAB04-BE65-429D-9A39-3E1BB43C521A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{464DAB04-BE65-429D-9A39-3E1BB43C521A}.Release|Any CPU.Build.0 = Release|Any CPU
{2142AB69-B483-4B0A-96DC-CFA87DEB11A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2142AB69-B483-4B0A-96DC-CFA87DEB11A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2142AB69-B483-4B0A-96DC-CFA87DEB11A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -75,10 +79,6 @@ Global
{71DDCC06-D993-47B0-92E3-5DD6E295FB8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{71DDCC06-D993-47B0-92E3-5DD6E295FB8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{71DDCC06-D993-47B0-92E3-5DD6E295FB8B}.Release|Any CPU.Build.0 = Release|Any CPU
{1903905B-13B3-4DA2-94E2-917F39588032}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1903905B-13B3-4DA2-94E2-917F39588032}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1903905B-13B3-4DA2-94E2-917F39588032}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1903905B-13B3-4DA2-94E2-917F39588032}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

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

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

@ -33,8 +33,8 @@ namespace MyFlib
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
//LargeImageEntity
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 = "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 image1 = new LargeImageEntity { Id = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}"), Base64 = "empty" };
LargeImageEntity image2 = new LargeImageEntity { Id = Guid.Parse("{9f9086f5-5cc5-47b5-af9b-a935f4e9b89c}"), Base64 = " " };
modelBuilder.Entity<LargeImageEntity>().HasData(image1, image2);

@ -0,0 +1,671 @@
// <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
}
}
}

@ -0,0 +1,375 @@
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");
}
}
}

@ -0,0 +1,668 @@
// <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