Update README and completion of the DbManager Champion
continuous-integration/drone/push Build is passing Details

pull/10/head
Emre KARTAL 2 years ago
parent 9dfa473ad3
commit ac20890cb6

Binary file not shown.

@ -191,6 +191,30 @@ réalisez à nouveau la migration (ou mettez à jour celle actuelle), puis suppr
<br> <br>
- ### Comment utiliser l'application MAUI ?
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.
Page **Home**:
<div align = center>
![start BD](doc/Images/MauiClientHome.png)
</div>
Page **Champions**:
<div align = center>
![start BD](doc/Images/MauiClientChampions.gif)
</div>
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:*
<img src="doc/Images/Title-Environnement.png" width="400" > <img src="doc/Images/Title-Environnement.png" width="400" >
Mon environnement de travail est basé sur un outil et un langage en particulier : 👇 Mon environnement de travail est basé sur un outil et un langage en particulier : 👇
@ -210,7 +234,7 @@ Mon environnement de travail est basé sur un outil et un langage en particulier
<img src="doc/Images/Title-Technicien.png" width="400" > <img src="doc/Images/Title-Technicien.png" width="400" >
:mortar_board: Emre KARTAL :mortar_board: Emre KARTAL : Emre.kartal@etu.uca.fr
<br> <br>

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

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

@ -1,7 +1,6 @@
using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.AspNetCore.Mvc.Versioning; using Microsoft.AspNetCore.Mvc.Versioning;
using Model; using Model;
using StubLib;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
@ -29,7 +28,7 @@ builder.Services.AddVersionedApiExplorer(setup =>
setup.SubstituteApiVersionInUrl = true; setup.SubstituteApiVersionInUrl = true;
}); });
builder.Services.AddSingleton<IDataManager, StubData>(); builder.Services.AddSingleton<IDataManager, DbLib.DbManager>();
var app = builder.Build(); var app = builder.Build();

@ -1,6 +1,8 @@
using Model; using DbManager.Mapper;
using Microsoft.EntityFrameworkCore;
using Model;
namespace DbManager namespace DbLib
{ {
public partial class DbManager public partial class DbManager
{ {
@ -11,94 +13,109 @@ namespace DbManager
public ChampionsManager(DbManager parent) public ChampionsManager(DbManager parent)
=> this.parent = parent; => this.parent = parent;
public Task<Champion?> AddItem(Champion? item) public async Task<Champion?> AddItem(Champion? item)
{ {
throw new NotImplementedException(); var champion = await parent.DbContext.Champions.AddAsync(item.ToEntity(parent.DbContext));
parent.DbContext.SaveChanges();
return champion.Entity.ToModel();
} }
public Task<bool> DeleteItem(Champion? item) public async Task<bool> DeleteItem(Champion? item)
{ {
throw new NotImplementedException(); var toDelete = parent.DbContext.Champions.Find(item.Name);
} if (toDelete != null)
public Task<IEnumerable<Champion?>> GetItemByName(string substring, int index, int count, string? orderingPropertyName = null, bool descending = false)
{ {
throw new NotImplementedException(); parent.DbContext.Champions.Remove(toDelete);
parent.DbContext.SaveChanges();
return true;
} }
return false;
public Task<IEnumerable<Champion?>> GetItems(int index, int count, string? orderingPropertyName = null, bool descending = false)
{
throw new NotImplementedException();
} }
public Task<IEnumerable<Champion?>> GetItemsByCharacteristic(string charName, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
throw new NotImplementedException();
}
public Task<IEnumerable<Champion?>> GetItemsByClass(ChampionClass championClass, int index, int count, string? orderingPropertyName = null, bool descending = false) private Func<Champion, string, bool> filterByNameContains = (champ, substring) => champ.Name.Contains(substring, StringComparison.InvariantCultureIgnoreCase);
{
throw new NotImplementedException();
}
public Task<IEnumerable<Champion?>> GetItemsByName(string substring, int index, int count, string? orderingPropertyName = null, bool descending = false) private Func<Champion, string, bool> filterByName = (champ, substring) => champ.Name.Equals(substring, StringComparison.InvariantCultureIgnoreCase);
{
throw new NotImplementedException();
}
public Task<IEnumerable<Champion?>> GetItemsByRunePage(RunePage? runePage, int index, int count, string? orderingPropertyName = null, bool descending = false) public async Task<IEnumerable<Champion?>> GetItemByName(string substring, int index, int count, string? orderingPropertyName = null, bool descending = false)
{ => parent.DbContext.Champions.GetItemsWithFilterAndOrdering(champ => filterByName(champ.ToModel(), substring), index, count, orderingPropertyName, descending)
throw new NotImplementedException(); .Select(c => c.ToModel());
}
public Task<IEnumerable<Champion?>> GetItemsBySkill(Skill? skill, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
throw new NotImplementedException();
}
public Task<IEnumerable<Champion?>> GetItemsBySkill(string skill, int index, int count, string? orderingPropertyName = null, bool descending = false) public async Task<IEnumerable<Champion?>> GetItems(int index, int count, string? orderingPropertyName = null, bool descending = false)
{ => parent.DbContext.Champions.GetItemsWithFilterAndOrdering(
throw new NotImplementedException(); c => true,
} index, count,
orderingPropertyName, descending).Select(c => c.ToModel());
public Task<int> GetNbItems() private Func<Champion, string, bool> filterByCharacteristic = (champ, charName) => champ.Characteristics.Keys.Any(k => k.Contains(charName, StringComparison.InvariantCultureIgnoreCase));
{
throw new NotImplementedException(); public async Task<IEnumerable<Champion?>> GetItemsByCharacteristic(string charName, int index, int count, string? orderingPropertyName = null, bool descending = false)
} => parent.DbContext.Champions.Include(c => c.Characteristics).GetItemsWithFilterAndOrdering(
champ => filterByCharacteristic(champ.ToModel(), charName),
index, count, orderingPropertyName, descending).Select(c => c.ToModel());
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)
=> parent.DbContext.Champions.GetItemsWithFilterAndOrdering(
champ => filterByClass(champ.ToModel(), championClass),
index, count, orderingPropertyName, descending).Select(c => c.ToModel());
public async Task<IEnumerable<Champion?>> GetItemsByName(string substring, int index, int count, string? orderingPropertyName = null, bool descending = false)
=> parent.DbContext.Champions.GetItemsWithFilterAndOrdering(champ => filterByNameContains(champ.ToModel(), substring), index, count, orderingPropertyName, descending)
.Select(c => c.ToModel());
public async Task<IEnumerable<Champion?>> GetItemsByRunePage(RunePage? runePage, int index, int count, string? orderingPropertyName = null, bool descending = false)
=> parent.DbContext.Champions.Include("RunePages").GetItemsWithFilterAndOrdering(
c => c.RunePages.Any(rp => rp.Equals(runePage.ToEntity(parent.DbContext))),
index, count,
orderingPropertyName, descending).Select(c => c.ToModel());
public async Task<IEnumerable<Champion?>> GetItemsBySkill(Skill? skill, int index, int count, string? orderingPropertyName = null, bool descending = false)
=> parent.DbContext.Champions.GetItemsWithFilterAndOrdering(champ => filterBySkill(champ.ToModel(), skill), index, count, orderingPropertyName, descending)
.Select(c => c.ToModel());
public async Task<IEnumerable<Champion?>> GetItemsBySkill(string skill, int index, int count, string? orderingPropertyName = null, bool descending = false)
=> parent.DbContext.Champions.GetItemsWithFilterAndOrdering(champ => filterBySkillSubstring(champ.ToModel(), skill), index, count, orderingPropertyName, descending)
.Select(c => c.ToModel());
public async Task<int> GetNbItems()
=> parent.DbContext.Champions.Count();
public Task<int> GetNbItemsByCharacteristic(string charName) public Task<int> GetNbItemsByCharacteristic(string charName)
{ => parent.DbContext.Champions.GetNbItemsWithFilter(champ => filterByCharacteristic(champ.ToModel(), charName));
throw new NotImplementedException();
}
public Task<int> GetNbItemsByClass(ChampionClass championClass) public async Task<int> GetNbItemsByClass(ChampionClass championClass)
{ => parent.DbContext.Champions.Where(c => c.Class.Equals(championClass))
throw new NotImplementedException(); .Count();
}
public Task<int> GetNbItemsByName(string substring) public async Task<int> GetNbItemsByName(string substring)
{ => parent.DbContext.Champions.Where(c => c.Name.Equals(substring))
throw new NotImplementedException(); .Count();
}
public Task<int> GetNbItemsByRunePage(RunePage? runePage) public async Task<int> GetNbItemsByRunePage(RunePage? runePage)
{ => parent.DbContext.Champions.Where(c => c.RunePages.Any(rp => rp.Equals(runePage.ToEntity(parent.DbContext))))
throw new NotImplementedException(); .Count();
}
private Func<Champion, Skill?, bool> filterBySkill = (champ, skill) => skill != null && champ.Skills.Contains(skill!);
public Task<int> GetNbItemsBySkill(Skill? skill) public Task<int> GetNbItemsBySkill(Skill? skill)
{ => parent.DbContext.Champions.GetNbItemsWithFilter(champ => filterBySkill(champ.ToModel(), skill));
throw new NotImplementedException();
} private static Func<Champion, string, bool> filterBySkillSubstring = (champ, skill) => champ.Skills.Any(s => s.Name.Contains(skill, StringComparison.InvariantCultureIgnoreCase));
public Task<int> GetNbItemsBySkill(string skill) public Task<int> GetNbItemsBySkill(string skill)
{ => parent.DbContext.Champions.GetNbItemsWithFilter(champ => filterBySkillSubstring(champ.ToModel(), skill));
throw new NotImplementedException();
}
public Task<Champion?> UpdateItem(Champion? oldItem, Champion? newItem) public async Task<Champion?> UpdateItem(Champion? oldItem, Champion? newItem)
{ {
throw new NotImplementedException(); var toUpdate = parent.DbContext.Champions.Find(oldItem.Name);
toUpdate = newItem.ToEntity(parent.DbContext);
parent.DbContext.SaveChanges();
return newItem;
} }
} }
} }

@ -5,7 +5,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace DbManager namespace DbLib
{ {
public partial class DbManager public partial class DbManager
{ {

@ -5,7 +5,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace DbManager namespace DbLib
{ {
public partial class DbManager public partial class DbManager
{ {

@ -5,7 +5,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace DbManager namespace DbLib
{ {
public partial class DbManager public partial class DbManager
{ {

@ -1,12 +1,22 @@
using Model; using Microsoft.EntityFrameworkCore;
using Model;
using MyFlib; using MyFlib;
namespace DbManager namespace DbLib
{ {
public partial class DbManager : IDataManager public partial class DbManager : IDataManager
{ {
protected LolDbContext DbContext { get; set; } protected LolDbContext DbContext { get; set; }
public DbManager()
{
DbContext = new LolDbContext();
ChampionsMgr = new ChampionsManager(this);
SkinsMgr = new SkinsManager(this);
RunesMgr = new RunesManager(this);
RunePagesMgr = new RunePagesManager(this);
}
public DbManager(LolDbContext dbContext) public DbManager(LolDbContext dbContext)
{ {
DbContext = dbContext; DbContext = dbContext;

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DbLib
{
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)));
}
}
}

@ -8,7 +8,7 @@ namespace DbManager.Mapper
{ {
public static Champion ToModel(this ChampionEntity championEntity) public static Champion ToModel(this ChampionEntity championEntity)
{ {
Champion champion = new (championEntity.Name, championEntity.Class.ToModel(), championEntity.Icon, championEntity.Image.Base64.ToString(), championEntity.Bio); Champion champion = new (championEntity.Name, championEntity.Class.ToModel(), championEntity.Icon, "", championEntity.Bio);
foreach (var skill in championEntity.Skills) foreach (var skill in championEntity.Skills)
{ {
champion.AddSkill(skill.ToModel()); champion.AddSkill(skill.ToModel());

@ -20,5 +20,29 @@ namespace DbManager.Mapper
} }
return runePage; return runePage;
} }
public static RunePageEntity ToEntity(this RunePage runePage, LolDbContext context)
{
RunePageEntity? runePageEntity = context.RunePages.Find(runePage.Name);
if (runePageEntity == null)
{
runePageEntity = new()
{
Name = runePage.Name,
};
runePageEntity.DictionaryCategoryRunes = new List<DictionaryCategoryRune>();
foreach (var r in runePage.Runes)
{
runePageEntity.DictionaryCategoryRunes.Add(new DictionaryCategoryRune()
{
category = r.Key.ToEntity(),
rune = r.Value.ToEntity(),
});
}
}
return runePageEntity;
}
} }
} }

@ -1,6 +1,8 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using MyFlib.Entities; using MyFlib.Entities;
using MyFlib.Entities.enums; using MyFlib.Entities.enums;
using System.IO;
using System.Reflection;
namespace MyFlib namespace MyFlib
{ {
@ -24,7 +26,8 @@ namespace MyFlib
{ {
if (!optionsBuilder.IsConfigured) if (!optionsBuilder.IsConfigured)
{ {
optionsBuilder.UseSqlite("Data Source=DataBase.db"); string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "..\\..\\..\\..\\MyFlib\\DataBase.db");
optionsBuilder.UseSqlite($"Data Source={path}");
} }
} }
protected override void OnModelCreating(ModelBuilder modelBuilder) protected override void OnModelCreating(ModelBuilder modelBuilder)

@ -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("20230325153221_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
}
}
}

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

@ -1,5 +1,5 @@
// See https://aka.ms/new-console-template for more information // See https://aka.ms/new-console-template for more information
using MyFlib; /*using MyFlib;
using static System.Console; using static System.Console;
using (var context = new LolDbContext()) using (var context = new LolDbContext())
@ -35,4 +35,4 @@ using (var context = new LolDbContext())
} }
context.SaveChangesAsync(); // or context.SaveChangesAsync context.SaveChangesAsync(); // or context.SaveChangesAsync
} }*/
Loading…
Cancel
Save