Merge branch 'master' of https://codefirst.iut.uca.fr/git/corentin.richard/EntityFramework_ConsoDeServices_TP into Versioning
continuous-integration/drone/push Build is passing Details

pull/21/head
Pierre Ferreira 2 years ago
commit 71623e077d

@ -4,6 +4,10 @@ using StubLib;
using DTO;
using DTO.Mapper;
using System.CodeDom.Compiler;
using System.Drawing;
using System;
using API_LoL.Mapper;
using System.Xml.Linq;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
@ -17,15 +21,17 @@ namespace API_LoL.Controllers
{
public ChampionsController(IDataManager Manager) {
this.ChampionsManager= Manager.ChampionsMgr;
this.ChampionsManager = Manager.ChampionsMgr;
this.SkinsManager = Manager.SkinsMgr;
}
private IChampionsManager ChampionsManager;
private ISkinsManager SkinsManager;
// GET api/<ChampionController>/5
[HttpGet]
public async Task<IActionResult> Get(String? name= null,String? skill = null, String? characteristic = null,int index = 0,int size =10)
public async Task<IActionResult> Get(string? name = null,String? skill = null, String? characteristic = null,int index = 0,int size =10)
{
if (size - index > 10)
{
@ -33,13 +39,14 @@ namespace API_LoL.Controllers
}
if (!string.IsNullOrEmpty(name))
{
var list = await ChampionsManager.GetItemsByName(name, index,size);
var list = await ChampionsManager.GetItemsByName(name, index, size);
if (list.Count() != 0)
{
return Ok(list.Select(champion => champion?.ToDTO()));
}
else { return NoContent(); }
}else if(!string.IsNullOrEmpty(skill)) {
}
else if(!string.IsNullOrEmpty(skill)) {
var list = await ChampionsManager.GetItemsBySkill(skill, index, size);
if (list.Count() != 0)
{
@ -65,8 +72,38 @@ namespace API_LoL.Controllers
}
}
// POST api/<ChampionController>
[HttpPost]
[HttpGet("name")]
public async Task<IActionResult> GetByName(String name)
{
if (string.IsNullOrEmpty(name)) return BadRequest();
var list = await ChampionsManager.GetItemsByName(name, 0, 1);
if (list.Count() == 1)
{
return Ok(list.Select(champion => champion?.ToDTO()).First());
}
else { return NoContent(); }
}
[HttpGet("name/skins")]
public async Task<IActionResult> GetSkinsByName(String name)
{
if (string.IsNullOrEmpty(name)) return BadRequest();
var list = await ChampionsManager.GetItemsByName(name, 0, 1);
if (list.Count() == 1)
{
var skins = await SkinsManager.GetItemsByChampion(list.First(), 0, await SkinsManager.GetNbItemsByChampion(list.First()));
if (skins.Count() != 0)
{
return Ok(skins.Select(skin => skin?.ToDTO()));
}
else { return NoContent(); }
}
else { return NoContent(); }
}
// POST api/<ChampionController>
[HttpPost]
public async Task<IActionResult> Post(ChampionDTO champion)
{
if (champion == null)

@ -0,0 +1,34 @@
using DTO;
using Model;
namespace API_LoL.Mapper
{
public static class ChampionClassMapper
{
public static string ToDTO(this ChampionClass championClass)
{
return championClass.ToString();
}
public static ChampionClass ToChampionClass(this String championClass)
{
switch (championClass)
{
case "Assassin":
return ChampionClass.Assassin;
case "Fighter":
return ChampionClass.Fighter;
case "Mage":
return ChampionClass.Mage;
case "Marksman":
return ChampionClass.Marksman;
case "Support":
return ChampionClass.Support;
case "Tank":
return ChampionClass.Tank;
default:
return ChampionClass.Unknown;
}
}
}
}

@ -1,4 +1,5 @@
using Model;
using API_LoL.Mapper;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
@ -11,13 +12,13 @@ namespace DTO.Mapper
{
public static ChampionDTO ToDTO(this Champion champion)
{
return new ChampionDTO(champion.Name, champion.Bio, champion.Icon);
return new ChampionDTO(champion.Name, champion.Bio, champion.Icon,champion.Class.ToDTO().ToString());
//return new ChampionDTO(champion.Name, champion.Bio, champion.Icon, champion.Skills);
}
public static Champion ToChampion(this ChampionDTO champion)
{
Champion champ = new Champion(champion.Name, ChampionClass.Unknown, champion.Icon, "", champion.Bio);
Champion champ = new Champion(champion.Name, champion.Class.ToChampionClass(), champion.Icon, "", champion.Bio);
//foreach (Skill skill in champion.Skills)
//{

@ -0,0 +1,18 @@
using DTO;
using Model;
namespace API_LoL.Mapper
{
public static class SkinMapper
{
public static SkinDTO ToDTO(this Skin skin)
{
return new SkinDTO(skin.Name, skin.Description, skin.Icon);
}
public static Skin ToSkin(this SkinDTO skin)
{
return new Skin(skin.Name, null, icon:skin.Icon) ;
}
}
}

@ -21,7 +21,7 @@ namespace Api_UT
public async Task Get_Default_OkList()
{
List<ChampionDTO> list = new List<ChampionDTO> {new ChampionDTO("Akali","",""), new ChampionDTO("Aatrox", "", ""), new ChampionDTO("Ahri", "", ""), new ChampionDTO("Akshan", "", ""), new ChampionDTO("Bard", "", ""), new ChampionDTO("Alistar", "", "") };
List<ChampionDTO> list = new List<ChampionDTO> {new ChampionDTO("Akali","","","Assassin"), new ChampionDTO("Aatrox", "", "", "Fighter"), new ChampionDTO("Ahri", "", "", "Mage"), new ChampionDTO("Akshan", "", "", "Marksman"), new ChampionDTO("Bard", "", "","Support"), new ChampionDTO("Alistar", "", "","Tank") };
IActionResult a = await api.Get();
a.Should().NotBeNull();
var aObject = a as OkObjectResult;
@ -42,7 +42,7 @@ namespace Api_UT
[TestMethod]
public async Task Get_2First_OkListOf2()
{
List<ChampionDTO> list = new List<ChampionDTO> { new ChampionDTO("Akali", "", ""), new ChampionDTO("Aatrox", "", "") };
List<ChampionDTO> list = new List<ChampionDTO> { new ChampionDTO("Akali", "", "", "Assassin"), new ChampionDTO("Aatrox", "", "", "Fighter") };
IActionResult a = await api.Get(index: 0,size: 2);
@ -57,7 +57,7 @@ namespace Api_UT
[TestMethod]
public async Task Get_FilterAName_OkListOf5()
{
List<ChampionDTO> list = new List<ChampionDTO> { new ChampionDTO("Akali", "", ""), new ChampionDTO("Akshan", "", "") };
List<ChampionDTO> list = new List<ChampionDTO> { new ChampionDTO("Akali", "", "", "Assassin"), new ChampionDTO("Akshan", "", "", "Marksman") };
IActionResult a = await api.Get(name: "Ak");
@ -75,9 +75,9 @@ namespace Api_UT
public async Task Post_ValidChampion_Created()
{
ChampionsController api = new ChampionsController(new StubData());
IActionResult a = await api.Post(new ChampionDTO("nom","bio","icon"));
IActionResult a = await api.Post(new ChampionDTO("nom","bio","icon", "Assassin"));
Assert.IsNotNull(a);
ChampionDTO champ = new ChampionDTO("nom", "bio", "icon");
ChampionDTO champ = new ChampionDTO("nom", "bio", "icon","Assassin");
Assert.IsTrue(champ.equals((ChampionDTO)((CreatedAtActionResult)a).Value));
}

@ -1,41 +0,0 @@
using API_LoL.Controllers;
using DTO;
using FluentAssertions;
using Microsoft.AspNetCore.Mvc;
using Model;
using StubLib;
namespace Api_UT
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public async Task TestGet()
{
List<ChampionDTO> list = new List<ChampionDTO> {new ChampionDTO("Akali","",""), new ChampionDTO("Aatrox", "", ""), new ChampionDTO("Ahri", "", ""), new ChampionDTO("Akshan", "", ""), new ChampionDTO("Bard", "", ""), new ChampionDTO("Alistar", "", "") };
ChampionsController api = new ChampionsController(new StubData());
IActionResult a = await api.Get();
/// utilisation du nuggets fluentAssertion
//Assert.IsNotNull(a);
a.Should().NotBeNull();
//Assert.AreEqual(list,((OkObjectResult)a).Value);
var aObject = a as OkObjectResult;
aObject.Should().NotBeNull();
var championresult = aObject.Value as IEnumerable<ChampionDTO>;
list.Should().BeEquivalentTo(championresult);
}
[TestMethod]
public async Task TestPostValid()
{
ChampionsController api = new ChampionsController(new StubData());
IActionResult a = await api.Post(new ChampionDTO("nom","bio","icon"));
Assert.IsNotNull(a);
ChampionDTO champ = new ChampionDTO("nom", "bio", "icon");
//Assert.AreEqual<ChampionDTO>(champ,((CreatedAtActionResult)a).Value);
}
}
}

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DTO
{
public class ChampionClassDTO
{
public string Name;
public ChampionClassDTO(string name) {
this.Name = name;
}
}
}

@ -5,26 +5,19 @@ namespace DTO
{
public class ChampionDTO
{
public ChampionDTO(string name, string bio, string icon)
public ChampionDTO(string name, string bio, string icon, string championClassDTO)
{
Name = name;
Bio = bio;
Icon = icon;
Class = championClassDTO;
}
//public ChampionDTO(string name, string bio, string icon, ICollection<Skill> skills)
//{
// Name = name;
// Bio = bio;
// Icon = icon;
// Skills = skills;
//}
public string Name { get; set; }
public string Bio { get; set; }
//public ChampionClass Class { get; set; }
public string Icon { get; set; }
public string Class { get; set; }
public bool equals(ChampionDTO other)
{
return other.Name==this.Name && other.Bio==this.Bio && other.Icon==this.Icon;

@ -0,0 +1,23 @@
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DTO
{
public class SkinDTO
{
public string Name { get; set; }
public string Description { get; set; }
public string Icon { get; set; }
public SkinDTO(string name,string description,string icon) {
this.Name = name;
this.Description = description;
this.Icon = icon;
}
}
}

@ -54,8 +54,8 @@ namespace EF_UT
//prepares the database with one instance of the context
using (var context = new LoLDbContext(options))
{
ChampionEntity chewie = new ChampionEntity("Chewbacca", "", "");
ChampionEntity yoda = new ChampionEntity("Yoda", "", "");
ChampionEntity chewie = new ChampionEntity("Chewbacca", "ewa", "");
ChampionEntity yoda = new ChampionEntity("Yoda", "wewo", "");
ChampionEntity ewok = new ChampionEntity("Ewok", "", "");
context.Add(chewie);
@ -67,23 +67,23 @@ namespace EF_UT
//prepares the database with one instance of the context
using (var context = new LoLDbContext(options))
{
string NameToFind = "ew";
Assert.AreEqual(2, context.Champions.Where(n => n.Name.ToLower().Contains(NameToFind)).Count());
NameToFind = "ewo";
Assert.AreEqual(1, context.Champions.Where(n => n.Name.ToLower().Contains(NameToFind)).Count());
var ewok = context.Champions.Where(n => n.Name.ToLower().Contains(NameToFind)).First();
ewok.Name = "Wicket";
string BioToFind = "ew";
Assert.AreEqual(2, context.Champions.Where(n => n.Bio.ToLower().Contains(BioToFind)).Count());
BioToFind = "ewo";
Assert.AreEqual(1, context.Champions.Where(n => n.Bio.ToLower().Contains(BioToFind)).Count());
var ewok = context.Champions.Where(n => n.Bio.ToLower().Contains(BioToFind)).First();
ewok.Bio = "Wicket";
context.SaveChanges();
}
//prepares the database with one instance of the context
using (var context = new LoLDbContext(options))
{
string NameToFind = "ew";
Assert.AreEqual(1, context.Champions.Where(n => n.Name.ToLower().Contains(NameToFind)).Count());
NameToFind = "wick";
Assert.AreEqual(1, context.Champions.Where(n => n.Name.ToLower().Contains(NameToFind)).Count());
}
//using (var context = new LoLDbContext(options))
//{
// string NameToFind = "ew";
// Assert.AreEqual(1, context.Champions.Where(n => n.Bio.ToLower().Contains(NameToFind)).Count());
// NameToFind = "wick";
// Assert.AreEqual(1, context.Champions.Where(n => n.Bio.ToLower().Contains(NameToFind)).Count());
//}
}
}
}

@ -13,11 +13,11 @@ namespace EntityFramework
[Table("Champion")]
public class ChampionEntity
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
//[Key]
//[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
//public int Id { get; set; }
[Required]
[Key]
[MaxLength(50)]
public string Name { get; set; }

@ -17,4 +17,8 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\StubLib\StubLib.csproj" />
</ItemGroup>
</Project>

@ -0,0 +1,25 @@
using EntityFramework.Mapper;
using Microsoft.EntityFrameworkCore;
using StubLib;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EntityFramework
{
public class LoLDBContextWithStub : LoLDbContext
{
protected override async void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
var stub = new StubData.ChampionsManager(new StubData());
var list = await stub.GetItems(0, await stub.GetNbItems());
modelBuilder.Entity<ChampionEntity>().HasData(
list.Select(champion => champion.ToEntity())
);
}
}
}

@ -29,11 +29,11 @@ namespace EntityFramework
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<ChampionEntity>().HasKey(entity => entity.Id);
modelBuilder.Entity<ChampionEntity>().HasKey(entity => entity.Name);
modelBuilder.Entity<ChampionEntity>().ToTable("Champion");
modelBuilder.Entity<ChampionEntity>().Property(entity => entity.Id)
.ValueGeneratedOnAdd();
//modelBuilder.Entity<ChampionEntity>().Property(entity => entity.Id)
// .ValueGeneratedOnAdd();
modelBuilder.Entity<ChampionEntity>().Property(entity => entity.Name)
.IsRequired()

@ -0,0 +1,16 @@
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EntityFramework.Mapper
{
public static class ChampionMapper
{
public static ChampionEntity ToEntity(this Champion champion) {
return new ChampionEntity(champion.Name, champion.Bio, champion.Icon);
}
}
}

@ -1,85 +0,0 @@
// <auto-generated />
using System;
using EntityFramework;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace EntityFramework.Migrations
{
[DbContext(typeof(LoLDbContext))]
[Migration("20230301152530_SkillMigration")]
partial class SkillMigration
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.2");
modelBuilder.Entity("EntityFramework.ChampionEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Bio")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("string")
.HasColumnName("Bio");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Champion", (string)null);
});
modelBuilder.Entity("EntityFramework.Skill", b =>
{
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<int?>("ChampionEntityId")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.HasKey("Name");
b.HasIndex("ChampionEntityId");
b.ToTable("Skill");
});
modelBuilder.Entity("EntityFramework.Skill", b =>
{
b.HasOne("EntityFramework.ChampionEntity", null)
.WithMany("Skills")
.HasForeignKey("ChampionEntityId");
});
modelBuilder.Entity("EntityFramework.ChampionEntity", b =>
{
b.Navigation("Skills");
});
#pragma warning restore 612, 618
}
}
}

@ -1,63 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace EntityFramework.Migrations
{
/// <inheritdoc />
public partial class SkillMigration : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Champion",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false),
Bio = table.Column<string>(type: "string", maxLength: 500, nullable: false),
Icon = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Champion", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Skill",
columns: table => new
{
Name = table.Column<string>(type: "TEXT", nullable: false),
Type = table.Column<int>(type: "INTEGER", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: false),
ChampionEntityId = table.Column<int>(type: "INTEGER", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Skill", x => x.Name);
table.ForeignKey(
name: "FK_Skill_Champion_ChampionEntityId",
column: x => x.ChampionEntityId,
principalTable: "Champion",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_Skill_ChampionEntityId",
table: "Skill",
column: "ChampionEntityId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Skill");
migrationBuilder.DropTable(
name: "Champion");
}
}
}

@ -0,0 +1,83 @@
// <auto-generated />
using EntityFramework;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace EntityFramework.Migrations
{
[DbContext(typeof(LoLDBContextWithStub))]
[Migration("20230312170120_stubMig")]
partial class stubMig
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.2");
modelBuilder.Entity("EntityFramework.ChampionEntity", b =>
{
b.Property<string>("Name")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Bio")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("string")
.HasColumnName("Bio");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Name");
b.ToTable("Champion", (string)null);
b.HasData(
new
{
Name = "Akali",
Bio = "",
Icon = ""
},
new
{
Name = "Aatrox",
Bio = "",
Icon = ""
},
new
{
Name = "Ahri",
Bio = "",
Icon = ""
},
new
{
Name = "Akshan",
Bio = "",
Icon = ""
},
new
{
Name = "Bard",
Bio = "",
Icon = ""
},
new
{
Name = "Alistar",
Bio = "",
Icon = ""
});
});
#pragma warning restore 612, 618
}
}
}

@ -0,0 +1,49 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace EntityFramework.Migrations
{
/// <inheritdoc />
public partial class stubMig : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Champion",
columns: table => new
{
Name = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false),
Bio = table.Column<string>(type: "string", maxLength: 500, nullable: false),
Icon = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Champion", x => x.Name);
});
migrationBuilder.InsertData(
table: "Champion",
columns: new[] { "Name", "Bio", "Icon" },
values: new object[,]
{
{ "Aatrox", "", "" },
{ "Ahri", "", "" },
{ "Akali", "", "" },
{ "Akshan", "", "" },
{ "Alistar", "", "" },
{ "Bard", "", "" }
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Champion");
}
}
}

@ -0,0 +1,80 @@
// <auto-generated />
using EntityFramework;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace EntityFramework.Migrations
{
[DbContext(typeof(LoLDBContextWithStub))]
partial class LoLDBContextWithStubModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.2");
modelBuilder.Entity("EntityFramework.ChampionEntity", b =>
{
b.Property<string>("Name")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Bio")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("string")
.HasColumnName("Bio");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Name");
b.ToTable("Champion", (string)null);
b.HasData(
new
{
Name = "Akali",
Bio = "",
Icon = ""
},
new
{
Name = "Aatrox",
Bio = "",
Icon = ""
},
new
{
Name = "Ahri",
Bio = "",
Icon = ""
},
new
{
Name = "Akshan",
Bio = "",
Icon = ""
},
new
{
Name = "Bard",
Bio = "",
Icon = ""
},
new
{
Name = "Alistar",
Bio = "",
Icon = ""
});
});
#pragma warning restore 612, 618
}
}
}

@ -1,82 +0,0 @@
// <auto-generated />
using System;
using EntityFramework;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace EntityFramework.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("EntityFramework.ChampionEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Bio")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("string")
.HasColumnName("Bio");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Champion", (string)null);
});
modelBuilder.Entity("EntityFramework.Skill", b =>
{
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<int?>("ChampionEntityId")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.HasKey("Name");
b.HasIndex("ChampionEntityId");
b.ToTable("Skill");
});
modelBuilder.Entity("EntityFramework.Skill", b =>
{
b.HasOne("EntityFramework.ChampionEntity", null)
.WithMany("Skills")
.HasForeignKey("ChampionEntityId");
});
modelBuilder.Entity("EntityFramework.ChampionEntity", b =>
{
b.Navigation("Skills");
});
#pragma warning restore 612, 618
}
}
}

@ -7,8 +7,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Model", "Model\Model.csproj
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{C76D0C23-1FFA-4963-93CD-E12BD643F030}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleTests", "Tests\ConsoleTests\ConsoleTests.csproj", "{1889FA6E-B7C6-416E-8628-9449FB9070B9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shared", "Shared\Shared.csproj", "{3B720C0C-53FE-4642-A2DB-87FD8634CD74}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Stub", "Stub", "{2C607793-B163-4731-A4D1-AFE8A7C4C170}"
@ -20,10 +18,13 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DTO", "DTO\DTO.csproj", "{E39C3FBC-DE5E-4DAF-945A-98CE4ADE54D9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityFramework", "EntityFramework\EntityFramework.csproj", "{23483395-5091-4956-822F-17234E8C9E5C}"
ProjectSection(ProjectDependencies) = postProject
{2960F9BA-49DE-494D-92E3-CE5A794BA1A9} = {2960F9BA-49DE-494D-92E3-CE5A794BA1A9}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Api_UT", "Api_UT\Api_UT.csproj", "{20A1A7DC-1E93-4506-BD32-8597A5DADD7B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EF_UT", "EF_UT\EF_UT.csproj", "{74F469C3-A94A-4507-9DC7-7DBADCD18173}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EF_UT", "EF_UT\EF_UT.csproj", "{74F469C3-A94A-4507-9DC7-7DBADCD18173}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -35,10 +36,6 @@ Global
{2960F9BA-49DE-494D-92E3-CE5A794BA1A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2960F9BA-49DE-494D-92E3-CE5A794BA1A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2960F9BA-49DE-494D-92E3-CE5A794BA1A9}.Release|Any CPU.Build.0 = Release|Any CPU
{1889FA6E-B7C6-416E-8628-9449FB9070B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1889FA6E-B7C6-416E-8628-9449FB9070B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1889FA6E-B7C6-416E-8628-9449FB9070B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1889FA6E-B7C6-416E-8628-9449FB9070B9}.Release|Any CPU.Build.0 = Release|Any CPU
{3B720C0C-53FE-4642-A2DB-87FD8634CD74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B720C0C-53FE-4642-A2DB-87FD8634CD74}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B720C0C-53FE-4642-A2DB-87FD8634CD74}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -72,7 +69,6 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{1889FA6E-B7C6-416E-8628-9449FB9070B9} = {C76D0C23-1FFA-4963-93CD-E12BD643F030}
{B01D7EF2-2D64-409A-A29A-61FB7BB7A9DB} = {2C607793-B163-4731-A4D1-AFE8A7C4C170}
{20A1A7DC-1E93-4506-BD32-8597A5DADD7B} = {C76D0C23-1FFA-4963-93CD-E12BD643F030}
{74F469C3-A94A-4507-9DC7-7DBADCD18173} = {C76D0C23-1FFA-4963-93CD-E12BD643F030}

Loading…
Cancel
Save