Push Modif EF + Manager EF (manque modif Mapper à pull)
continuous-integration/drone/push Build is failing Details

ApiSkill
Louison PARANT 2 years ago
parent 096dc87b5f
commit 3fc3ddff6c

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

@ -1,4 +1,5 @@
using DTO;
using EntityFrameworkLOL.Entities;
using Model;
namespace APILOL.Mapper
@ -21,7 +22,24 @@ namespace APILOL.Mapper
public static Champion ToModel(this ChampionDTO champion)
{
return new Champion(champion.Name/*, champion.Class, champion.Icon, champion.Image.ToString(), champion.Bio*/);
return new Champion(champion.Name, champion.Class, champion.Icon, champion.Image.ToString(), champion.Bio);
}
public static ChampionEntity ToEntity(this Champion item)
{
return new()
{
Name = item.Name,
Bio = item.Bio,
Icon = item.Icon,
Class = item.Class,
Image = new() { Base64 = item.Image.Base64 },
};
}
public static Champion ToModel(this ChampionEntity entity)
{
return new(entity.Name, entity.Class, entity.Icon, entity.Image.Base64, entity.Bio);
}
}
}

@ -1,18 +1,15 @@
using EntityFrameworkLOL.Entities;
using Microsoft.EntityFrameworkCore;
using Model;
namespace EntityFrameworkLOL.DBContexts
{
class SQLiteContext : DbContext
public class SQLiteContext : DbContext
{
public DbSet<CategoryEntity> Category { get; set; }
public DbSet<RuneFamilyEntity> RuneFamily { get; set; }
public DbSet<ImageEntity> Image { get; set; }
public DbSet<SkillTypeEntity> SkillType { get; set; }
public DbSet<SkillEntity> Skill { get; set; }
public DbSet<SkinEntity> Skin { get; set; }
public DbSet<RuneEntity> Rune { get; set; }
public DbSet<ChampionClassEntity> ChampionClass { get; set; }
public DbSet<RunePageEntity> RunePage { get; set; }
public DbSet<ChampionEntity> Champion { get; set; }
@ -21,15 +18,101 @@ namespace EntityFrameworkLOL.DBContexts
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
// Fluent API
}
public SQLiteContext()
{ }
modelBuilder.Entity<ImageEntity>().Property(i => i.Base64).ValueGeneratedOnAdd();
modelBuilder.Entity<CharacteristicEntity>().HasKey(c => new { c.Name, c.Champion });
modelBuilder.Entity<RunePageEntity>().Property(rp => rp.Name).ValueGeneratedOnAdd();
modelBuilder.Entity<RunePageEntity>()
.HasMany(rp => rp.Runes)
.WithMany(r => r.RunePages)
.UsingEntity<RunePageRuneEntity>();
modelBuilder.Entity<ChampionEntity>()
.HasMany(c => c.RunePages)
.WithMany(rp => rp.Champions);
modelBuilder.Entity<ImageEntity>().HasData(new List<ImageEntity>()
{
new()
{
Base64 = "default"
}
});
modelBuilder.Entity<ChampionEntity>().HasData(new List<ChampionEntity>() {
new()
{
Name = "WinKer",
Bio = "Best front-end designer",
Class = ChampionClass.Mage,
public SQLiteContext(DbContextOptions<SQLiteContext> options)
: base(options)
{ }
},
new()
{
Name = "Jonquille",
Bio = "Daffodil",
Class = ChampionClass.Support,
}
});
modelBuilder.Entity<CharacteristicEntity>().HasData(new List<CharacteristicEntity>() {
new()
{
Name = "Front-end",
Value = 100,
},
new()
{
Name = "Back-end",
Value = 100,
}
});
modelBuilder.Entity<SkinEntity>().HasData(new List<SkinEntity>() {
new SkinEntity
{
Name = "Darker WinKer",
Description = "Be invisible in the darkness but never alone",
Icon = "default",
Price=9.99F
},
new SkinEntity
{
Name = "Summer Daffodil",
Description = "A jewel of Summer for all year long",
Icon = "default",
Price=9.99F
},
});
modelBuilder.Entity<SkillEntity>().HasData(new List<SkillEntity>() {
new()
{
Name = "Beautiful layout",
Description = "Bowl'In",
Type = SkillType.Ultimate
},
new()
{
Name = "DB Support",
Description = "DB",
Type = SkillType.Basic
}
});
modelBuilder.Entity<RunePageEntity>().HasData(new List<RunePageEntity>()
{
new()
{
Name="FirstRunepage"
}
});
modelBuilder.Entity<RuneEntity>().HasData(new List<RuneEntity>() {
new()
{
Name = "Mastering of Blue",
Description = "Blue shades",
Family = RuneFamily.Domination
},
new()
{
Name = "Empty Shards",
Description = "Remove runes",
Family = RuneFamily.Precision
}
});
}
}
}

@ -1,24 +0,0 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.Xml.Linq;
using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations.Schema;
using Model;
using static System.Net.Mime.MediaTypeNames;
using System.Reflection.PortableExecutable;
using System.Security.Claims;
namespace EntityFrameworkLOL.Entities
{
class CategoryEntity
{
[Key]
[ForeignKey("RunePageEntity")]
public RunePage.Category Category { get; set; }
}
}

@ -15,24 +15,25 @@ using System.Security.Claims;
namespace EntityFrameworkLOL.Entities
{
class ChampionEntity
public class ChampionEntity
{
[Key]
public string Name { get; set; }
[Required]
public string Bio { get; set; }
public string Icon { get; set; }
[NotMapped]
public Dictionary<string, int> Characteristics { get; set; }
// Switch Dictionary to List puis faudra juste mapper la liste en dico
public ChampionClassEntity Class { get; set; }
[Required]
public ChampionClass Class { get; set; }
public ImageEntity Image { get; set; }
//[NotMapped]
public virtual ICollection<SkillEntity> Skills { get; set; }
public virtual ICollection<CharacteristicEntity> Characteristics { get; set; }
public ICollection<RunePageEntity> RunePages { get; set; }
}
}

@ -1,21 +1,23 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Linq;
using System.Threading.Tasks;
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel.DataAnnotations;
using Model;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EntityFrameworkLOL.Entities;
namespace EntityFrameworkLOL.Entities
{
class ChampionClassEntity
public class CharacteristicEntity
{
[Key]
[ForeignKey("ChampionEntity")]
public int Id { get; set; }
public string Name { get; set; }
public ChampionClass Class { get; set; }
[Required]
public int Value { get; set; }
[ForeignKey("ChampionEntity")]
public ChampionEntity Champion { get; set; }
}
}

@ -15,7 +15,7 @@ using System.Security.Claims;
namespace EntityFrameworkLOL.Entities
{
class ImageEntity
public class ImageEntity
{
[Key]
[ForeignKey("ChampionEntity")]

@ -5,10 +5,11 @@ using System.Threading.Tasks;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel.DataAnnotations;
using Model;
namespace EntityFrameworkLOL.Entities
{
class RuneEntity
public class RuneEntity
{
[Key]
public string Name { get; set; }
@ -17,8 +18,9 @@ namespace EntityFrameworkLOL.Entities
public ImageEntity Image { get; set; }
public RuneFamilyEntity Family { get; set; }
[Required]
public RuneFamily Family { get; set; }
public ICollection<RunePageEntity> Pages { get; set; }
public ICollection<RunePageEntity> RunePages { get; set; }
}
}

@ -1,21 +0,0 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel.DataAnnotations;
using Model;
using System.ComponentModel.DataAnnotations.Schema;
namespace EntityFrameworkLOL.Entities
{
class RuneFamilyEntity
{
[Key]
[ForeignKey("RuneEntity")]
public int Id { get; set; }
public RuneFamily Family { get; set; }
}
}

@ -15,15 +15,13 @@ using System.Security.Claims;
namespace EntityFrameworkLOL.Entities
{
class RunePageEntity
public class RunePageEntity
{
[Key]
public string Name { get; set; }
[NotMapped]
public Dictionary<CategoryEntity, RuneEntity> Dictionary { get; set; }
// Switch Dictionary to List puis faudra juste mapper la liste en dico
public ICollection<RuneEntity> Runes { get; set; }
public ICollection<RuneEntity> Entities { get; set; }
public ICollection<ChampionEntity> Champions { get; set; }
}
}

@ -0,0 +1,15 @@
using Shared;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static Model.RunePage;
namespace EntityFrameworkLOL.Entities
{
public class RunePageRuneEntity
{
public Category Category { get; set; }
}
}

@ -6,19 +6,20 @@ using System.Collections.Generic;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Model;
namespace EntityFrameworkLOL.Entities
{
class SkillEntity
public class SkillEntity
{
[Key]
public string Name { get; set; }
public string Description { get; set; }
public SkillTypeEntity Type { get; set; }
[Required]
public SkillType Type { get; set; }
//[NotMapped]
public virtual ICollection<ChampionEntity> Champions { get; set; }
}
}

@ -1,21 +0,0 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel.DataAnnotations;
using Model;
using System.ComponentModel.DataAnnotations.Schema;
namespace EntityFrameworkLOL.Entities
{
class SkillTypeEntity
{
[Key]
[ForeignKey("SkillEntity")]
public int Id { get; set; }
public SkillType Type { get; set; }
}
}

@ -8,7 +8,7 @@ using System.ComponentModel.DataAnnotations;
namespace EntityFrameworkLOL.Entities
{
class SkinEntity
public class SkinEntity
{
[Key]
public string Name { get; set; }

@ -1,291 +0,0 @@
// <auto-generated />
using EntityFrameworkLOL.DBContexts;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace EntityFrameworkLOL.Migrations
{
[DbContext(typeof(SQLiteContext))]
[Migration("20230209135613_MigrationWallah5")]
partial class MigrationWallah5
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.2");
modelBuilder.Entity("ChampionEntitySkillEntity", b =>
{
b.Property<string>("ChampionsName")
.HasColumnType("TEXT");
b.Property<string>("SkillsName")
.HasColumnType("TEXT");
b.HasKey("ChampionsName", "SkillsName");
b.HasIndex("SkillsName");
b.ToTable("ChampionEntitySkillEntity");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.CategoryEntity", b =>
{
b.Property<int>("Category")
.HasColumnType("INTEGER");
b.HasKey("Category");
b.ToTable("Category");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.ChampionClassEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("Class")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("ChampionClass");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.ChampionEntity", b =>
{
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("Bio")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("ClassId")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("ImageBase64")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Name");
b.HasIndex("ClassId");
b.HasIndex("ImageBase64");
b.ToTable("Champion");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.ImageEntity", b =>
{
b.Property<string>("Base64")
.HasColumnType("TEXT");
b.HasKey("Base64");
b.ToTable("Image");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.RuneEntity", b =>
{
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("FamilyId")
.HasColumnType("INTEGER");
b.Property<string>("ImageBase64")
.HasColumnType("TEXT");
b.HasKey("Name");
b.HasIndex("FamilyId");
b.HasIndex("ImageBase64");
b.ToTable("Rune");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.RuneFamilyEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("Family")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("RuneFamily");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.RunePageEntity", b =>
{
b.Property<string>("Name")
.HasColumnType("TEXT");
b.HasKey("Name");
b.ToTable("RunePage");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.SkillEntity", b =>
{
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("TypeId")
.HasColumnType("INTEGER");
b.HasKey("Name");
b.HasIndex("TypeId");
b.ToTable("Skill");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.SkillTypeEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("SkillType");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.SkinEntity", b =>
{
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("ChampionSkinName")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("ImageBase64")
.HasColumnType("TEXT");
b.Property<float>("Price")
.HasColumnType("REAL");
b.HasKey("Name");
b.HasIndex("ChampionSkinName");
b.HasIndex("ImageBase64");
b.ToTable("Skin");
});
modelBuilder.Entity("ChampionEntitySkillEntity", b =>
{
b.HasOne("EntityFrameworkLOL.Entities.ChampionEntity", null)
.WithMany()
.HasForeignKey("ChampionsName")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("EntityFrameworkLOL.Entities.SkillEntity", null)
.WithMany()
.HasForeignKey("SkillsName")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.ChampionEntity", b =>
{
b.HasOne("EntityFrameworkLOL.Entities.ChampionClassEntity", "Class")
.WithMany()
.HasForeignKey("ClassId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("EntityFrameworkLOL.Entities.ImageEntity", "Image")
.WithMany()
.HasForeignKey("ImageBase64")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Class");
b.Navigation("Image");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.RuneEntity", b =>
{
b.HasOne("EntityFrameworkLOL.Entities.RuneFamilyEntity", "Family")
.WithMany()
.HasForeignKey("FamilyId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("EntityFrameworkLOL.Entities.ImageEntity", "Image")
.WithMany()
.HasForeignKey("ImageBase64");
b.Navigation("Family");
b.Navigation("Image");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.SkillEntity", b =>
{
b.HasOne("EntityFrameworkLOL.Entities.SkillTypeEntity", "Type")
.WithMany()
.HasForeignKey("TypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Type");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.SkinEntity", b =>
{
b.HasOne("EntityFrameworkLOL.Entities.ChampionEntity", "ChampionSkin")
.WithMany()
.HasForeignKey("ChampionSkinName");
b.HasOne("EntityFrameworkLOL.Entities.ImageEntity", "Image")
.WithMany()
.HasForeignKey("ImageBase64");
b.Navigation("ChampionSkin");
b.Navigation("Image");
});
#pragma warning restore 612, 618
}
}
}

@ -1,284 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace EntityFrameworkLOL.Migrations
{
/// <inheritdoc />
public partial class MigrationWallah5 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Category",
columns: table => new
{
Category = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Category", x => x.Category);
});
migrationBuilder.CreateTable(
name: "ChampionClass",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Class = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ChampionClass", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Image",
columns: table => new
{
Base64 = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Image", x => x.Base64);
});
migrationBuilder.CreateTable(
name: "RuneFamily",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Family = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_RuneFamily", x => x.Id);
});
migrationBuilder.CreateTable(
name: "RunePage",
columns: table => new
{
Name = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_RunePage", x => x.Name);
});
migrationBuilder.CreateTable(
name: "SkillType",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Type = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SkillType", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Champion",
columns: table => new
{
Name = table.Column<string>(type: "TEXT", nullable: false),
Bio = table.Column<string>(type: "TEXT", nullable: false),
Icon = table.Column<string>(type: "TEXT", nullable: false),
ClassId = table.Column<int>(type: "INTEGER", nullable: false),
ImageBase64 = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Champion", x => x.Name);
table.ForeignKey(
name: "FK_Champion_ChampionClass_ClassId",
column: x => x.ClassId,
principalTable: "ChampionClass",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Champion_Image_ImageBase64",
column: x => x.ImageBase64,
principalTable: "Image",
principalColumn: "Base64",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Rune",
columns: table => new
{
Name = table.Column<string>(type: "TEXT", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: false),
ImageBase64 = table.Column<string>(type: "TEXT", nullable: true),
FamilyId = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Rune", x => x.Name);
table.ForeignKey(
name: "FK_Rune_Image_ImageBase64",
column: x => x.ImageBase64,
principalTable: "Image",
principalColumn: "Base64");
table.ForeignKey(
name: "FK_Rune_RuneFamily_FamilyId",
column: x => x.FamilyId,
principalTable: "RuneFamily",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Skill",
columns: table => new
{
Name = table.Column<string>(type: "TEXT", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: false),
TypeId = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Skill", x => x.Name);
table.ForeignKey(
name: "FK_Skill_SkillType_TypeId",
column: x => x.TypeId,
principalTable: "SkillType",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Skin",
columns: table => new
{
Name = table.Column<string>(type: "TEXT", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: false),
Icon = table.Column<string>(type: "TEXT", nullable: false),
Price = table.Column<float>(type: "REAL", nullable: false),
ImageBase64 = table.Column<string>(type: "TEXT", nullable: true),
ChampionSkinName = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Skin", x => x.Name);
table.ForeignKey(
name: "FK_Skin_Champion_ChampionSkinName",
column: x => x.ChampionSkinName,
principalTable: "Champion",
principalColumn: "Name");
table.ForeignKey(
name: "FK_Skin_Image_ImageBase64",
column: x => x.ImageBase64,
principalTable: "Image",
principalColumn: "Base64");
});
migrationBuilder.CreateTable(
name: "ChampionEntitySkillEntity",
columns: table => new
{
ChampionsName = table.Column<string>(type: "TEXT", nullable: false),
SkillsName = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ChampionEntitySkillEntity", x => new { x.ChampionsName, x.SkillsName });
table.ForeignKey(
name: "FK_ChampionEntitySkillEntity_Champion_ChampionsName",
column: x => x.ChampionsName,
principalTable: "Champion",
principalColumn: "Name",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ChampionEntitySkillEntity_Skill_SkillsName",
column: x => x.SkillsName,
principalTable: "Skill",
principalColumn: "Name",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Champion_ClassId",
table: "Champion",
column: "ClassId");
migrationBuilder.CreateIndex(
name: "IX_Champion_ImageBase64",
table: "Champion",
column: "ImageBase64");
migrationBuilder.CreateIndex(
name: "IX_ChampionEntitySkillEntity_SkillsName",
table: "ChampionEntitySkillEntity",
column: "SkillsName");
migrationBuilder.CreateIndex(
name: "IX_Rune_FamilyId",
table: "Rune",
column: "FamilyId");
migrationBuilder.CreateIndex(
name: "IX_Rune_ImageBase64",
table: "Rune",
column: "ImageBase64");
migrationBuilder.CreateIndex(
name: "IX_Skill_TypeId",
table: "Skill",
column: "TypeId");
migrationBuilder.CreateIndex(
name: "IX_Skin_ChampionSkinName",
table: "Skin",
column: "ChampionSkinName");
migrationBuilder.CreateIndex(
name: "IX_Skin_ImageBase64",
table: "Skin",
column: "ImageBase64");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Category");
migrationBuilder.DropTable(
name: "ChampionEntitySkillEntity");
migrationBuilder.DropTable(
name: "Rune");
migrationBuilder.DropTable(
name: "RunePage");
migrationBuilder.DropTable(
name: "Skin");
migrationBuilder.DropTable(
name: "Skill");
migrationBuilder.DropTable(
name: "RuneFamily");
migrationBuilder.DropTable(
name: "Champion");
migrationBuilder.DropTable(
name: "SkillType");
migrationBuilder.DropTable(
name: "ChampionClass");
migrationBuilder.DropTable(
name: "Image");
}
}
}

@ -1,288 +0,0 @@
// <auto-generated />
using EntityFrameworkLOL.DBContexts;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace EntityFrameworkLOL.Migrations
{
[DbContext(typeof(SQLiteContext))]
partial class SQLiteContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.2");
modelBuilder.Entity("ChampionEntitySkillEntity", b =>
{
b.Property<string>("ChampionsName")
.HasColumnType("TEXT");
b.Property<string>("SkillsName")
.HasColumnType("TEXT");
b.HasKey("ChampionsName", "SkillsName");
b.HasIndex("SkillsName");
b.ToTable("ChampionEntitySkillEntity");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.CategoryEntity", b =>
{
b.Property<int>("Category")
.HasColumnType("INTEGER");
b.HasKey("Category");
b.ToTable("Category");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.ChampionClassEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("Class")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("ChampionClass");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.ChampionEntity", b =>
{
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("Bio")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("ClassId")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("ImageBase64")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Name");
b.HasIndex("ClassId");
b.HasIndex("ImageBase64");
b.ToTable("Champion");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.ImageEntity", b =>
{
b.Property<string>("Base64")
.HasColumnType("TEXT");
b.HasKey("Base64");
b.ToTable("Image");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.RuneEntity", b =>
{
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("FamilyId")
.HasColumnType("INTEGER");
b.Property<string>("ImageBase64")
.HasColumnType("TEXT");
b.HasKey("Name");
b.HasIndex("FamilyId");
b.HasIndex("ImageBase64");
b.ToTable("Rune");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.RuneFamilyEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("Family")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("RuneFamily");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.RunePageEntity", b =>
{
b.Property<string>("Name")
.HasColumnType("TEXT");
b.HasKey("Name");
b.ToTable("RunePage");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.SkillEntity", b =>
{
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("TypeId")
.HasColumnType("INTEGER");
b.HasKey("Name");
b.HasIndex("TypeId");
b.ToTable("Skill");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.SkillTypeEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("SkillType");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.SkinEntity", b =>
{
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("ChampionSkinName")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("ImageBase64")
.HasColumnType("TEXT");
b.Property<float>("Price")
.HasColumnType("REAL");
b.HasKey("Name");
b.HasIndex("ChampionSkinName");
b.HasIndex("ImageBase64");
b.ToTable("Skin");
});
modelBuilder.Entity("ChampionEntitySkillEntity", b =>
{
b.HasOne("EntityFrameworkLOL.Entities.ChampionEntity", null)
.WithMany()
.HasForeignKey("ChampionsName")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("EntityFrameworkLOL.Entities.SkillEntity", null)
.WithMany()
.HasForeignKey("SkillsName")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.ChampionEntity", b =>
{
b.HasOne("EntityFrameworkLOL.Entities.ChampionClassEntity", "Class")
.WithMany()
.HasForeignKey("ClassId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("EntityFrameworkLOL.Entities.ImageEntity", "Image")
.WithMany()
.HasForeignKey("ImageBase64")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Class");
b.Navigation("Image");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.RuneEntity", b =>
{
b.HasOne("EntityFrameworkLOL.Entities.RuneFamilyEntity", "Family")
.WithMany()
.HasForeignKey("FamilyId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("EntityFrameworkLOL.Entities.ImageEntity", "Image")
.WithMany()
.HasForeignKey("ImageBase64");
b.Navigation("Family");
b.Navigation("Image");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.SkillEntity", b =>
{
b.HasOne("EntityFrameworkLOL.Entities.SkillTypeEntity", "Type")
.WithMany()
.HasForeignKey("TypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Type");
});
modelBuilder.Entity("EntityFrameworkLOL.Entities.SkinEntity", b =>
{
b.HasOne("EntityFrameworkLOL.Entities.ChampionEntity", "ChampionSkin")
.WithMany()
.HasForeignKey("ChampionSkinName");
b.HasOne("EntityFrameworkLOL.Entities.ImageEntity", "Image")
.WithMany()
.HasForeignKey("ImageBase64");
b.Navigation("ChampionSkin");
b.Navigation("Image");
});
#pragma warning restore 612, 618
}
}
}

@ -21,7 +21,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DTO", "DTO\DTO.csproj", "{1
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityFrameworkLOL", "EntityFrameworkLOL\EntityFrameworkLOL.csproj", "{61D807B0-FA1A-439D-9810-9F31A0C47034}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestUnitaire", "TestUnitaire\TestUnitaire.csproj", "{D24FBC48-F9C3-45CA-8D51-A851559C307F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUnitaire", "TestUnitaire\TestUnitaire.csproj", "{D24FBC48-F9C3-45CA-8D51-A851559C307F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagersEF", "ManagersEF\ManagersEF.csproj", "{A8685E74-67E4-4382-AF91-38045AC0014B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -61,6 +63,10 @@ Global
{D24FBC48-F9C3-45CA-8D51-A851559C307F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D24FBC48-F9C3-45CA-8D51-A851559C307F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D24FBC48-F9C3-45CA-8D51-A851559C307F}.Release|Any CPU.Build.0 = Release|Any CPU
{A8685E74-67E4-4382-AF91-38045AC0014B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A8685E74-67E4-4382-AF91-38045AC0014B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A8685E74-67E4-4382-AF91-38045AC0014B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A8685E74-67E4-4382-AF91-38045AC0014B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

@ -0,0 +1,136 @@
using Model;
using Shared;
using System.Data.SqlTypes;
using APILOL.Mapper;
namespace ManagersEF
{
public partial class EFManager
{
public class ChampionsManager : IChampionsManager
{
private readonly EFManager parent;
public ChampionsManager(EFManager parent)
=> this.parent = parent;
public async Task<Champion?> AddItem(Champion? item)
{
await parent.DbContext.Champion.AddAsync(item.ToEntity());
return item;
}
public async Task<bool> DeleteItem(Champion? item)
{
parent.DbContext.Champion.Remove(item.ToEntity());
return true;
}
public async Task<IEnumerable<Champion?>> GetItems(int index, int count, string? orderingPropertyName = null, bool descending = false)
{
return parent.DbContext.Champion.GetItemsWithFilterAndOrdering(
c => true,
index, count,
orderingPropertyName, descending).Select(c => c.ToModel());
}
public async Task<IEnumerable<Champion?>> GetItemsByCharacteristic(string charName, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
return parent.DbContext.Champion.GetItemsWithFilterAndOrdering(
c => c.Characteristics.Any(ch => ch.Name.Equals(charName)),
index, count,
orderingPropertyName, descending).Select(c => c.ToModel());
}
public async Task<IEnumerable<Champion?>> GetItemsByClass(ChampionClass championClass, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
return parent.DbContext.Champion.GetItemsWithFilterAndOrdering(
c => c.Class.Equals(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)
{
return parent.DbContext.Champion.GetItemsWithFilterAndOrdering(
c => c.Name.Contains(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)
{
return parent.DbContext.Champion.GetItemsWithFilterAndOrdering(
c => c.RunePages.Any(rp => rp.Equals(runePage.ToEntity())),
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)
{
return parent.DbContext.Champion.GetItemsWithFilterAndOrdering(
c => skill != null && c.Skills.Any(s => s.Name.Equals(skill.Name)),
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)
{
return parent.DbContext.Champion.GetItemsWithFilterAndOrdering(
c => skill != null && c.Skills.Any(s => s.Name.Equals(skill)),
index, count,
orderingPropertyName, descending).Select(c => c.ToModel());
}
public async Task<int> GetNbItems()
{
return parent.DbContext.Champion.Count();
}
public async Task<int> GetNbItemsByCharacteristic(string charName)
{
return parent.DbContext.Champion.Where(c => c.Characteristics.Any(ch => ch.Name.Equals(charName))).Count();
}
public async Task<int> GetNbItemsByClass(ChampionClass championClass)
{
return parent.DbContext.Champion.Where(c => c.Class.Equals(championClass))
.Count();
}
public async Task<int> GetNbItemsByName(string substring)
{
return parent.DbContext.Champion.Where(c => c.Name.Contains(substring))
.Count();
}
public async Task<int> GetNbItemsByRunePage(RunePage? runePage)
{
return parent.DbContext.Champion.Where(c => c.RunePages.Any(rp => rp.Equals(runePage.ToEntity()))).Count();
}
public async Task<int> GetNbItemsBySkill(Skill? skill)
{
return parent.DbContext.Champion.Where(c => skill != null && c.Skills.Any(s => s.Name.Equals(skill.Name)))
.Count();
}
public async Task<int> GetNbItemsBySkill(string skill)
{
return parent.DbContext.Champion.Where(c => skill != null && c.Skills.Any(s => s.Name.Equals(skill)))
.Count();
}
public async Task<Champion?> UpdateItem(Champion? oldItem, Champion? newItem)
{
parent.DbContext.Champion.Remove(oldItem.ToEntity());
parent.DbContext.Champion.Add(newItem.ToEntity());
return newItem;
}
}
}
}

@ -0,0 +1,92 @@
using APILOL.Mapper;
using ManagersEF;
using Model;
using System.Data.SqlTypes;
using System.Linq;
namespace ManagersEF
{
public partial class EFManager
{
public class RunePagesManager : IRunePagesManager
{
private readonly EFManager parent;
public RunePagesManager(EFManager parent)
=> this.parent = parent;
public async Task<RunePage?> AddItem(RunePage? item)
{
await parent.DbContext.RunePage.AddAsync(item.ToEntity());
return item;
}
public async Task<bool> DeleteItem(RunePage? item)
{
parent.DbContext.RunePage.Remove(item.ToEntity());
return true;
}
public async Task<IEnumerable<RunePage?>> GetItems(int index, int count, string? orderingPropertyName = null, bool descending = false)
{
return parent.DbContext.RunePage.GetItemsWithFilterAndOrdering(
rp => true,
index, count,
orderingPropertyName, descending).Select(rp => rp.ToModel());
}
public async Task<IEnumerable<RunePage?>> GetItemsByChampion(Champion? champion, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
return parent.DbContext.RunePage.GetItemsWithFilterAndOrdering(
rp => rp.Champions.Any(c => c.Name.Equals(champion.Name)),
index, count,
orderingPropertyName, descending).Select(rp => rp.ToModel());
}
public async Task<IEnumerable<RunePage?>> GetItemsByName(string substring, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
return parent.DbContext.RunePage.GetItemsWithFilterAndOrdering(
rp => rp.Name.Contains(substring),
index, count,
orderingPropertyName, descending).Select(rp => rp.ToModel());
}
public async Task<IEnumerable<RunePage?>> GetItemsByRune(Rune? rune, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
return parent.DbContext.RunePage.GetItemsWithFilterAndOrdering(
rp => rp.Runes.Any(r => r.Name.Equals(rune.Name)),
index, count,
orderingPropertyName, descending).Select(rp => rp.ToModel());
}
public async Task<int> GetNbItems()
{
return parent.DbContext.RunePage.Count();
}
public async Task<int> GetNbItemsByChampion(Champion? champion)
{
return parent.DbContext.RunePage.Where(rp => rp.Champions.Any(c => c.Name.Equals(champion.Name))).Count();
}
public async Task<int> GetNbItemsByName(string substring)
{
return parent.DbContext.RunePage.Where(rp => rp.Name.Contains(substring)).Count();
}
public async Task<int> GetNbItemsByRune(Model.Rune? rune)
{
return parent.DbContext.RunePage.Where(rp => rp.Runes.Any(r => r.Name.Equals(rune.Name))).Count();
}
public async Task<RunePage?> UpdateItem(RunePage? oldItem, RunePage? newItem)
{
parent.DbContext.RunePage.Remove(oldItem.ToEntity());
parent.DbContext.RunePage.Add(newItem.ToEntity());
return newItem;
}
}
}
}

@ -0,0 +1,74 @@
using APILOL.Mapper;
using Model;
using Shared;
namespace ManagersEF
{
public partial class EFManager
{
public class RunesManager : IRunesManager
{
private readonly EFManager parent;
public RunesManager(EFManager parent)
=> this.parent = parent;
public async Task<Rune?> AddItem(Rune? item)
{
await parent.DbContext.Rune.AddAsync(item.ToEntity());
return item;
}
public async Task<bool> DeleteItem(Rune? item)
{
parent.DbContext.Rune.Remove(item.ToEntity());
return true;
}
public async Task<IEnumerable<Rune?>> GetItems(int index, int count, string? orderingPropertyName = null, bool descending = false)
{
return parent.DbContext.Rune.GetItemsWithFilterAndOrdering(
r => true,
index, count,
orderingPropertyName, descending).Select(r => r.ToModel());
}
public async Task<IEnumerable<Rune?>> GetItemsByFamily(RuneFamily family, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
return parent.DbContext.Rune.GetItemsWithFilterAndOrdering(
r => r.Family.Equals(family),
index, count,
orderingPropertyName, descending).Select(r => r.ToModel());
}
public async Task<IEnumerable<Rune?>> GetItemsByName(string substring, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
return parent.DbContext.Rune.GetItemsWithFilterAndOrdering(
r => r.Name.Contains(substring),
index, count,
orderingPropertyName, descending).Select(r => r.ToModel());
}
public async Task<int> GetNbItems()
{
return parent.DbContext.Rune.Count();
}
public async Task<int> GetNbItemsByFamily(RuneFamily family)
{
return parent.DbContext.Rune.Where(r => r.Family.Equals(family)).Count();
}
public async Task<int> GetNbItemsByName(string substring)
{
return parent.DbContext.Rune.Where(r => r.Name.Contains(substring)).Count();
}
public async Task<Rune?> UpdateItem(Rune? oldItem, Rune? newItem)
{
parent.DbContext.Rune.Remove(oldItem.ToEntity());
parent.DbContext.Rune.Add(newItem.ToEntity());
return newItem;
}
}
}
}

@ -0,0 +1,77 @@
using APILOL.Mapper;
using Model;
using System.Data.SqlTypes;
namespace ManagersEF
{
public partial class EFManager
{
public class SkinsManager : ISkinsManager
{
private readonly EFManager parent;
public SkinsManager(EFManager parent)
=> this.parent = parent;
public async Task<Skin?> AddItem(Skin? item)
{
await parent.DbContext.Skin.AddAsync(item.ToEntity());
return item;
}
public async Task<bool> DeleteItem(Skin? item)
{
parent.DbContext.Skin.Remove(item.ToEntity());
return true;
}
public async Task<IEnumerable<Skin?>> GetItems(int index, int count, string? orderingPropertyName = null, bool descending = false)
{
return parent.DbContext.Skin.GetItemsWithFilterAndOrdering(
s => true,
index, count,
orderingPropertyName, descending).Select(s => s.ToModel());
}
public async Task<IEnumerable<Skin?>> GetItemsByChampion(Champion? champion, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
return parent.DbContext.Skin.GetItemsWithFilterAndOrdering(
s => s.Champion.Name.Equals(champion.Name),
index, count,
orderingPropertyName, descending).Select(s => s.ToModel());
}
public async Task<IEnumerable<Skin?>> GetItemsByName(string substring, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
return parent.DbContext.Skin.GetItemsWithFilterAndOrdering(
s => s.Name.Contains(substring),
index, count,
orderingPropertyName, descending).Select(s => s.ToModel());
}
public async Task<int> GetNbItems()
{
return parent.DbContext.Skin.Count();
}
public async Task<int> GetNbItemsByChampion(Champion? champion)
{
return parent.DbContext.Skin.Where(s => s.Champion.Name.Equals(champion.Name))
.Count();
}
public async Task<int> GetNbItemsByName(string substring)
{
return parent.DbContext.Skin.Where(s => s.Name.Contains(substring))
.Count();
}
public async Task<Skin?> UpdateItem(Skin? oldItem, Skin? newItem)
{
parent.DbContext.Skin.Remove(oldItem.ToEntity());
parent.DbContext.Skin.Add(newItem.ToEntity());
return newItem;
}
}
}
}

@ -0,0 +1,28 @@
using Microsoft.EntityFrameworkCore;
using Model;
using EntityFrameworkLOL.DBContexts;
namespace ManagersEF
{
public partial class EFManager : IDataManager
{
public EFManager(SQLiteContext dbContext)
{
DbContext = dbContext;
ChampionsMgr = new ChampionsManager(this);
SkinsMgr = new SkinsManager(this);
RunesMgr = new RunesManager(this);
RunePagesMgr = new RunePagesManager(this);
}
protected SQLiteContext DbContext { get; }
public IChampionsManager ChampionsMgr { get; }
public ISkinsManager SkinsMgr { get; }
public IRunesManager RunesMgr { get; }
public IRunePagesManager RunePagesMgr { get; }
}
}

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

@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Model\Model.csproj" />
<ProjectReference Include="..\EntityFrameworkLOL\EntityFrameworkLOL.csproj" />
<ProjectReference Include="..\APILOL\APILOL.csproj" />
</ItemGroup>
</Project>
Loading…
Cancel
Save