From 5bf297f7b115cab3b78d8bf117e01d23f94feff8 Mon Sep 17 00:00:00 2001 From: Pierre Ferreira Date: Mon, 13 Mar 2023 17:10:41 +0100 Subject: [PATCH] push de migration marchant sans le second hasdata, push pour merge --- Sources/EntityFramework/ChampionEntity.cs | 2 +- .../20230313155631_MyMigr.Designer.cs | 145 ++++++++++++++++ .../Migrations/20230313155631_MyMigr.cs | 110 ++++++++++++ .../Migrations/LoLDbContextModelSnapshot.cs | 142 +++++++++++++++ .../Stubbed/20230313160034_MyMigr.Designer.cs | 161 ++++++++++++++++++ .../Stubbed/20230313160034_MyMigr.cs | 121 +++++++++++++ .../Stubbed/StubbedContextModelSnapshot.cs | 158 +++++++++++++++++ Sources/EntityFramework/StubbedContext.cs | 4 +- 8 files changed, 840 insertions(+), 3 deletions(-) create mode 100644 Sources/EntityFramework/Migrations/20230313155631_MyMigr.Designer.cs create mode 100644 Sources/EntityFramework/Migrations/20230313155631_MyMigr.cs create mode 100644 Sources/EntityFramework/Migrations/LoLDbContextModelSnapshot.cs create mode 100644 Sources/EntityFramework/Migrations/Stubbed/20230313160034_MyMigr.Designer.cs create mode 100644 Sources/EntityFramework/Migrations/Stubbed/20230313160034_MyMigr.cs create mode 100644 Sources/EntityFramework/Migrations/Stubbed/StubbedContextModelSnapshot.cs diff --git a/Sources/EntityFramework/ChampionEntity.cs b/Sources/EntityFramework/ChampionEntity.cs index 8a975d2..1810ae8 100644 --- a/Sources/EntityFramework/ChampionEntity.cs +++ b/Sources/EntityFramework/ChampionEntity.cs @@ -15,7 +15,7 @@ namespace EntityFramework { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - public int Id { get; set; } = Guid.NewGuid().GetHashCode(); + public int Id { get; set; } [Required] [MaxLength(50)] diff --git a/Sources/EntityFramework/Migrations/20230313155631_MyMigr.Designer.cs b/Sources/EntityFramework/Migrations/20230313155631_MyMigr.Designer.cs new file mode 100644 index 0000000..7c3459c --- /dev/null +++ b/Sources/EntityFramework/Migrations/20230313155631_MyMigr.Designer.cs @@ -0,0 +1,145 @@ +// +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("20230313155631_MyMigr")] + partial class MyMigr + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "7.0.2"); + + modelBuilder.Entity("EntityFramework.ChampionEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Bio") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("string") + .HasColumnName("Bio"); + + b.Property("Icon") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Image") + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Champion", (string)null); + }); + + modelBuilder.Entity("EntityFramework.LargeImageEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Base64") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Image"); + }); + + modelBuilder.Entity("EntityFramework.SkillEntity", b => + { + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("ChampionEntityId") + .HasColumnType("INTEGER"); + + b.Property("Description") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Type") + .HasColumnType("INTEGER"); + + b.HasKey("Name"); + + b.HasIndex("ChampionEntityId"); + + b.ToTable("SkillEntity"); + }); + + modelBuilder.Entity("EntityFramework.SkinEntity", b => + { + b.Property("Name") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("ChampionEntityForeignKey") + .HasColumnType("INTEGER"); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("Icon") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Image") + .HasColumnType("TEXT"); + + b.Property("Price") + .HasColumnType("REAL"); + + b.HasKey("Name"); + + b.HasIndex("ChampionEntityForeignKey"); + + b.ToTable("Skins"); + }); + + modelBuilder.Entity("EntityFramework.SkillEntity", b => + { + b.HasOne("EntityFramework.ChampionEntity", null) + .WithMany("Skills") + .HasForeignKey("ChampionEntityId"); + }); + + modelBuilder.Entity("EntityFramework.SkinEntity", b => + { + b.HasOne("EntityFramework.ChampionEntity", "Champion") + .WithMany("skins") + .HasForeignKey("ChampionEntityForeignKey") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Champion"); + }); + + modelBuilder.Entity("EntityFramework.ChampionEntity", b => + { + b.Navigation("Skills"); + + b.Navigation("skins"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Sources/EntityFramework/Migrations/20230313155631_MyMigr.cs b/Sources/EntityFramework/Migrations/20230313155631_MyMigr.cs new file mode 100644 index 0000000..913356a --- /dev/null +++ b/Sources/EntityFramework/Migrations/20230313155631_MyMigr.cs @@ -0,0 +1,110 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EntityFramework.Migrations +{ + /// + public partial class MyMigr : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Champion", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Name = table.Column(type: "TEXT", maxLength: 50, nullable: false), + Bio = table.Column(type: "string", maxLength: 500, nullable: false), + Icon = table.Column(type: "TEXT", nullable: false), + Image = table.Column(type: "TEXT", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Champion", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Image", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Base64 = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Image", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "SkillEntity", + columns: table => new + { + Name = table.Column(type: "TEXT", nullable: false), + Type = table.Column(type: "INTEGER", nullable: false), + Description = table.Column(type: "TEXT", nullable: false), + ChampionEntityId = table.Column(type: "INTEGER", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_SkillEntity", x => x.Name); + table.ForeignKey( + name: "FK_SkillEntity_Champion_ChampionEntityId", + column: x => x.ChampionEntityId, + principalTable: "Champion", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Skins", + columns: table => new + { + Name = table.Column(type: "TEXT", nullable: false), + Description = table.Column(type: "TEXT", nullable: true), + Icon = table.Column(type: "TEXT", nullable: false), + Image = table.Column(type: "TEXT", nullable: true), + Price = table.Column(type: "REAL", nullable: false), + ChampionEntityForeignKey = table.Column(type: "INTEGER", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Skins", x => x.Name); + table.ForeignKey( + name: "FK_Skins_Champion_ChampionEntityForeignKey", + column: x => x.ChampionEntityForeignKey, + principalTable: "Champion", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_SkillEntity_ChampionEntityId", + table: "SkillEntity", + column: "ChampionEntityId"); + + migrationBuilder.CreateIndex( + name: "IX_Skins_ChampionEntityForeignKey", + table: "Skins", + column: "ChampionEntityForeignKey"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Image"); + + migrationBuilder.DropTable( + name: "SkillEntity"); + + migrationBuilder.DropTable( + name: "Skins"); + + migrationBuilder.DropTable( + name: "Champion"); + } + } +} diff --git a/Sources/EntityFramework/Migrations/LoLDbContextModelSnapshot.cs b/Sources/EntityFramework/Migrations/LoLDbContextModelSnapshot.cs new file mode 100644 index 0000000..410088f --- /dev/null +++ b/Sources/EntityFramework/Migrations/LoLDbContextModelSnapshot.cs @@ -0,0 +1,142 @@ +// +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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Bio") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("string") + .HasColumnName("Bio"); + + b.Property("Icon") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Image") + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Champion", (string)null); + }); + + modelBuilder.Entity("EntityFramework.LargeImageEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Base64") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Image"); + }); + + modelBuilder.Entity("EntityFramework.SkillEntity", b => + { + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("ChampionEntityId") + .HasColumnType("INTEGER"); + + b.Property("Description") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Type") + .HasColumnType("INTEGER"); + + b.HasKey("Name"); + + b.HasIndex("ChampionEntityId"); + + b.ToTable("SkillEntity"); + }); + + modelBuilder.Entity("EntityFramework.SkinEntity", b => + { + b.Property("Name") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("ChampionEntityForeignKey") + .HasColumnType("INTEGER"); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("Icon") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Image") + .HasColumnType("TEXT"); + + b.Property("Price") + .HasColumnType("REAL"); + + b.HasKey("Name"); + + b.HasIndex("ChampionEntityForeignKey"); + + b.ToTable("Skins"); + }); + + modelBuilder.Entity("EntityFramework.SkillEntity", b => + { + b.HasOne("EntityFramework.ChampionEntity", null) + .WithMany("Skills") + .HasForeignKey("ChampionEntityId"); + }); + + modelBuilder.Entity("EntityFramework.SkinEntity", b => + { + b.HasOne("EntityFramework.ChampionEntity", "Champion") + .WithMany("skins") + .HasForeignKey("ChampionEntityForeignKey") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Champion"); + }); + + modelBuilder.Entity("EntityFramework.ChampionEntity", b => + { + b.Navigation("Skills"); + + b.Navigation("skins"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Sources/EntityFramework/Migrations/Stubbed/20230313160034_MyMigr.Designer.cs b/Sources/EntityFramework/Migrations/Stubbed/20230313160034_MyMigr.Designer.cs new file mode 100644 index 0000000..5fdbb12 --- /dev/null +++ b/Sources/EntityFramework/Migrations/Stubbed/20230313160034_MyMigr.Designer.cs @@ -0,0 +1,161 @@ +// +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.Stubbed +{ + [DbContext(typeof(StubbedContext))] + [Migration("20230313160034_MyMigr")] + partial class MyMigr + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "7.0.2"); + + modelBuilder.Entity("EntityFramework.ChampionEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Bio") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("string") + .HasColumnName("Bio"); + + b.Property("Icon") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Image") + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Champion", (string)null); + + b.HasData( + new + { + Id = 1673124670, + Bio = "biobiobiobio", + Icon = "/a/a/a/a", + Name = "Corichard" + }, + new + { + Id = -96935452, + Bio = "mimimimimim", + Icon = "/small.png", + Name = "Pintrand" + }); + }); + + modelBuilder.Entity("EntityFramework.LargeImageEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Base64") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Image"); + }); + + modelBuilder.Entity("EntityFramework.SkillEntity", b => + { + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("ChampionEntityId") + .HasColumnType("INTEGER"); + + b.Property("Description") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Type") + .HasColumnType("INTEGER"); + + b.HasKey("Name"); + + b.HasIndex("ChampionEntityId"); + + b.ToTable("SkillEntity"); + }); + + modelBuilder.Entity("EntityFramework.SkinEntity", b => + { + b.Property("Name") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("ChampionEntityForeignKey") + .HasColumnType("INTEGER"); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("Icon") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Image") + .HasColumnType("TEXT"); + + b.Property("Price") + .HasColumnType("REAL"); + + b.HasKey("Name"); + + b.HasIndex("ChampionEntityForeignKey"); + + b.ToTable("Skins"); + }); + + modelBuilder.Entity("EntityFramework.SkillEntity", b => + { + b.HasOne("EntityFramework.ChampionEntity", null) + .WithMany("Skills") + .HasForeignKey("ChampionEntityId"); + }); + + modelBuilder.Entity("EntityFramework.SkinEntity", b => + { + b.HasOne("EntityFramework.ChampionEntity", "Champion") + .WithMany("skins") + .HasForeignKey("ChampionEntityForeignKey") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Champion"); + }); + + modelBuilder.Entity("EntityFramework.ChampionEntity", b => + { + b.Navigation("Skills"); + + b.Navigation("skins"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Sources/EntityFramework/Migrations/Stubbed/20230313160034_MyMigr.cs b/Sources/EntityFramework/Migrations/Stubbed/20230313160034_MyMigr.cs new file mode 100644 index 0000000..a7f4acb --- /dev/null +++ b/Sources/EntityFramework/Migrations/Stubbed/20230313160034_MyMigr.cs @@ -0,0 +1,121 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional + +namespace EntityFramework.Migrations.Stubbed +{ + /// + public partial class MyMigr : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Champion", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Name = table.Column(type: "TEXT", maxLength: 50, nullable: false), + Bio = table.Column(type: "string", maxLength: 500, nullable: false), + Icon = table.Column(type: "TEXT", nullable: false), + Image = table.Column(type: "TEXT", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Champion", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Image", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Base64 = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Image", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "SkillEntity", + columns: table => new + { + Name = table.Column(type: "TEXT", nullable: false), + Type = table.Column(type: "INTEGER", nullable: false), + Description = table.Column(type: "TEXT", nullable: false), + ChampionEntityId = table.Column(type: "INTEGER", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_SkillEntity", x => x.Name); + table.ForeignKey( + name: "FK_SkillEntity_Champion_ChampionEntityId", + column: x => x.ChampionEntityId, + principalTable: "Champion", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Skins", + columns: table => new + { + Name = table.Column(type: "TEXT", nullable: false), + Description = table.Column(type: "TEXT", nullable: true), + Icon = table.Column(type: "TEXT", nullable: false), + Image = table.Column(type: "TEXT", nullable: true), + Price = table.Column(type: "REAL", nullable: false), + ChampionEntityForeignKey = table.Column(type: "INTEGER", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Skins", x => x.Name); + table.ForeignKey( + name: "FK_Skins_Champion_ChampionEntityForeignKey", + column: x => x.ChampionEntityForeignKey, + principalTable: "Champion", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.InsertData( + table: "Champion", + columns: new[] { "Id", "Bio", "Icon", "Image", "Name" }, + values: new object[,] + { + { -96935452, "mimimimimim", "/small.png", null, "Pintrand" }, + { 1673124670, "biobiobiobio", "/a/a/a/a", null, "Corichard" } + }); + + migrationBuilder.CreateIndex( + name: "IX_SkillEntity_ChampionEntityId", + table: "SkillEntity", + column: "ChampionEntityId"); + + migrationBuilder.CreateIndex( + name: "IX_Skins_ChampionEntityForeignKey", + table: "Skins", + column: "ChampionEntityForeignKey"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Image"); + + migrationBuilder.DropTable( + name: "SkillEntity"); + + migrationBuilder.DropTable( + name: "Skins"); + + migrationBuilder.DropTable( + name: "Champion"); + } + } +} diff --git a/Sources/EntityFramework/Migrations/Stubbed/StubbedContextModelSnapshot.cs b/Sources/EntityFramework/Migrations/Stubbed/StubbedContextModelSnapshot.cs new file mode 100644 index 0000000..3181e7d --- /dev/null +++ b/Sources/EntityFramework/Migrations/Stubbed/StubbedContextModelSnapshot.cs @@ -0,0 +1,158 @@ +// +using System; +using EntityFramework; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace EntityFramework.Migrations.Stubbed +{ + [DbContext(typeof(StubbedContext))] + partial class StubbedContextModelSnapshot : 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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Bio") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("string") + .HasColumnName("Bio"); + + b.Property("Icon") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Image") + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Champion", (string)null); + + b.HasData( + new + { + Id = 1673124670, + Bio = "biobiobiobio", + Icon = "/a/a/a/a", + Name = "Corichard" + }, + new + { + Id = -96935452, + Bio = "mimimimimim", + Icon = "/small.png", + Name = "Pintrand" + }); + }); + + modelBuilder.Entity("EntityFramework.LargeImageEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Base64") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Image"); + }); + + modelBuilder.Entity("EntityFramework.SkillEntity", b => + { + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("ChampionEntityId") + .HasColumnType("INTEGER"); + + b.Property("Description") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Type") + .HasColumnType("INTEGER"); + + b.HasKey("Name"); + + b.HasIndex("ChampionEntityId"); + + b.ToTable("SkillEntity"); + }); + + modelBuilder.Entity("EntityFramework.SkinEntity", b => + { + b.Property("Name") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("ChampionEntityForeignKey") + .HasColumnType("INTEGER"); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("Icon") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Image") + .HasColumnType("TEXT"); + + b.Property("Price") + .HasColumnType("REAL"); + + b.HasKey("Name"); + + b.HasIndex("ChampionEntityForeignKey"); + + b.ToTable("Skins"); + }); + + modelBuilder.Entity("EntityFramework.SkillEntity", b => + { + b.HasOne("EntityFramework.ChampionEntity", null) + .WithMany("Skills") + .HasForeignKey("ChampionEntityId"); + }); + + modelBuilder.Entity("EntityFramework.SkinEntity", b => + { + b.HasOne("EntityFramework.ChampionEntity", "Champion") + .WithMany("skins") + .HasForeignKey("ChampionEntityForeignKey") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Champion"); + }); + + modelBuilder.Entity("EntityFramework.ChampionEntity", b => + { + b.Navigation("Skills"); + + b.Navigation("skins"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Sources/EntityFramework/StubbedContext.cs b/Sources/EntityFramework/StubbedContext.cs index a7936e3..47aa944 100644 --- a/Sources/EntityFramework/StubbedContext.cs +++ b/Sources/EntityFramework/StubbedContext.cs @@ -18,8 +18,8 @@ namespace EntityFramework { base.OnModelCreating(modelBuilder); - ChampionEntity corichard = new ChampionEntity {Name="Corichard", Bio="biobiobiobio", Icon="/a/a/a/a"}; - ChampionEntity pintrand = new ChampionEntity { Name = "Pintrand", Bio = "mimimimimim", Icon = "/small.png" }; + ChampionEntity corichard = new ChampionEntity {Id=1, Name="Corichard", Bio="biobiobiobio", Icon="/a/a/a/a"}; + ChampionEntity pintrand = new ChampionEntity {Id=2, Name = "Pintrand", Bio = "mimimimimim", Icon = "/small.png" }; //ChampionEntity corichard = new ChampionEntity() { Name = "Corichard", Bio = "biobiobiobio", Icon = "/a/a/a/a", Image = new LargeImageEntity { Base64 = "base" } }; //ChampionEntity pintrand = new ChampionEntity { Name = "Pintrand", Bio = "mimimimimim", Icon = "/small.png", Image = new LargeImageEntity { Base64 = "base" } };