fix bd + pb Tests Unit 🐛
continuous-integration/drone/push Build is passing Details

pagination
Tony Fages 1 year ago
parent 80b429936f
commit 739f157fbc

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
<mapping directory="$PROJECT_DIR$/.." vcs="Git" /> <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component> </component>
</project> </project>

@ -39,7 +39,7 @@ app.MapControllers();
using var scoped = app.Services.CreateScope(); using var scoped = app.Services.CreateScope();
var libraryContext = scoped.ServiceProvider.GetService<LibraryContext>(); var libraryContext = scoped.ServiceProvider.GetService<LibraryContext>();
//libraryContext.Database.EnsureCreated(); //libraryContext.Database.EnsureCreated();
libraryContext.Database.Migrate(); libraryContext.Database.Migrate();
app.Run(); app.Run();

@ -1,89 +0,0 @@
using DbContextLib;
using Entities;
using Microsoft.EntityFrameworkCore;
namespace StubbedContextLib;
public class StubbedContext : LibraryContext
{
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<ArticleEntity>().HasData(
new ArticleEntity
{
Id = 1,
Title = "Breaking News Elisabeth 2 Died",
Description = "The queen of England died today at the age of 95",
DatePublished = "2022-02-06",
LectureTime = 2,
Author = "Tom Smith"
},
new ArticleEntity
{
Id = 2,
Title = "The new iPhone 15",
Description = "The new iPhone 15 is out and it's the best phone ever",
DatePublished = "2022-02-06",
LectureTime = 3,
Author = "Tom Smith"
},
new ArticleEntity
{
Id = 3,
Title = "M&M's new recipe",
Description = "M&M's new recipe is out and it's the best chocolate ever",
DatePublished = "2022-02-06",
LectureTime = 1,
Author = "M&M's Red"
}
);
modelBuilder.Entity<UserEntity>().HasData(
new UserEntity
{
Nom = "Fages", Prenom = "Tony", Pseudo = "TonyF", Mail = "tony@gmail.com", Mdp = "1234", Role = "Admin"
},
new UserEntity
{
Nom = "Smith", Prenom = "Tom", Pseudo = "TomS", Mail = "tom@mail.com", Mdp = "1234",
Role = "User"
},
new UserEntity
{
Nom = "M&M's", Prenom = "Red", Pseudo = "RedM", Mail = "M&M#mail.com", Mdp = "1234", Role = "Modérator"
}
);
modelBuilder.Entity<ArticleUserEntity>().HasData(
new ArticleUserEntity
{
ArticleEntityId = 1,
UserEntityPseudo = "Sha"
},
new ArticleUserEntity
{
ArticleEntityId = 2,
UserEntityPseudo = "Sha"
},
new ArticleUserEntity
{
ArticleEntityId = 3,
UserEntityPseudo = "Sha"
},
new ArticleUserEntity
{
ArticleEntityId = 3,
UserEntityPseudo = "Sha"
},
new ArticleUserEntity
{
ArticleEntityId = 2,
UserEntityPseudo = "Sha"
}
);
}
}

@ -51,7 +51,6 @@ public class LibraryContext : DbContext
.HasOne(f => f.User) .HasOne(f => f.User)
.WithMany(u => u.Forms) .WithMany(u => u.Forms)
.HasForeignKey(f => f.UserEntityPseudo); .HasForeignKey(f => f.UserEntityPseudo);
/* /*
modelBuilder.Entity<ArticleEntity>().HasData( modelBuilder.Entity<ArticleEntity>().HasData(
new ArticleEntity new ArticleEntity

@ -10,7 +10,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace DbContextLib.Migrations namespace DbContextLib.Migrations
{ {
[DbContext(typeof(LibraryContext))] [DbContext(typeof(LibraryContext))]
[Migration("20240311132206_mrg1")] [Migration("20240312155559_mrg1")]
partial class mrg1 partial class mrg1
{ {
/// <inheritdoc /> /// <inheritdoc />
@ -83,12 +83,12 @@ namespace DbContextLib.Migrations
b.Property<long>("ArticleEntityId") b.Property<long>("ArticleEntityId")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
b.Property<long>("UserEntityId") b.Property<string>("UserEntityPseudo")
.HasColumnType("INTEGER"); .HasColumnType("TEXT");
b.HasKey("ArticleEntityId", "UserEntityId"); b.HasKey("ArticleEntityId", "UserEntityPseudo");
b.HasIndex("UserEntityId"); b.HasIndex("UserEntityPseudo");
b.ToTable("ArticleUserSet"); b.ToTable("ArticleUserSet");
@ -96,27 +96,27 @@ namespace DbContextLib.Migrations
new new
{ {
ArticleEntityId = 1L, ArticleEntityId = 1L,
UserEntityId = 1L UserEntityPseudo = "TonyF"
}, },
new new
{ {
ArticleEntityId = 2L, ArticleEntityId = 2L,
UserEntityId = 2L UserEntityPseudo = "NoaSil"
}, },
new new
{ {
ArticleEntityId = 3L, ArticleEntityId = 3L,
UserEntityId = 3L UserEntityPseudo = "Sha"
}, },
new new
{ {
ArticleEntityId = 3L, ArticleEntityId = 3L,
UserEntityId = 1L UserEntityPseudo = "RedM"
}, },
new new
{ {
ArticleEntityId = 2L, ArticleEntityId = 2L,
UserEntityId = 3L UserEntityPseudo = "TomS"
}); });
}); });
@ -134,20 +134,17 @@ namespace DbContextLib.Migrations
.IsRequired() .IsRequired()
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Pseudo") b.Property<string>("Theme")
.IsRequired() .IsRequired()
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Theme") b.Property<string>("UserEntityPseudo")
.IsRequired() .IsRequired()
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<long>("UserEntityId")
.HasColumnType("INTEGER");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("UserEntityId"); b.HasIndex("UserEntityPseudo");
b.ToTable("FormSet"); b.ToTable("FormSet");
@ -157,35 +154,31 @@ namespace DbContextLib.Migrations
Id = 1L, Id = 1L,
DatePublication = "Form 1 Description", DatePublication = "Form 1 Description",
Link = "hhtp://form1.com", Link = "hhtp://form1.com",
Pseudo = "Form 1",
Theme = "", Theme = "",
UserEntityId = 1L UserEntityPseudo = "Sha"
}, },
new new
{ {
Id = 2L, Id = 2L,
DatePublication = "Form 2 Description", DatePublication = "Form 2 Description",
Link = "hhtp://form2.com", Link = "hhtp://form2.com",
Pseudo = "Form 2",
Theme = "", Theme = "",
UserEntityId = 2L UserEntityPseudo = "Sha"
}, },
new new
{ {
Id = 3L, Id = 3L,
DatePublication = "Form 3 Description", DatePublication = "Form 3 Description",
Link = "hhtp://form3.com", Link = "hhtp://form3.com",
Pseudo = "Form 3",
Theme = "", Theme = "",
UserEntityId = 3L UserEntityPseudo = "Sha"
}); });
}); });
modelBuilder.Entity("Entities.UserEntity", b => modelBuilder.Entity("Entities.UserEntity", b =>
{ {
b.Property<long>("Id") b.Property<string>("Pseudo")
.ValueGeneratedOnAdd() .HasColumnType("TEXT");
.HasColumnType("INTEGER");
b.Property<string>("Mail") b.Property<string>("Mail")
.IsRequired() .IsRequired()
@ -203,67 +196,58 @@ namespace DbContextLib.Migrations
.IsRequired() .IsRequired()
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Pseudo")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Role") b.Property<string>("Role")
.IsRequired() .IsRequired()
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.HasKey("Id"); b.HasKey("Pseudo");
b.ToTable("UserSet"); b.ToTable("UserSet");
b.HasData( b.HasData(
new new
{ {
Id = 1L, Pseudo = "TonyF",
Mail = "tony@gmail.com", Mail = "tony@gmail.com",
Mdp = "1234", Mdp = "1234",
Nom = "Fages", Nom = "Fages",
Prenom = "Tony", Prenom = "Tony",
Pseudo = "TonyF",
Role = "Admin" Role = "Admin"
}, },
new new
{ {
Id = 2L, Pseudo = "TomS",
Mail = "tom@mail.com", Mail = "tom@mail.com",
Mdp = "1234", Mdp = "1234",
Nom = "Smith", Nom = "Smith",
Prenom = "Tom", Prenom = "Tom",
Pseudo = "TomS",
Role = "User" Role = "User"
}, },
new new
{ {
Id = 3L, Pseudo = "RedM",
Mail = "M&M#mail.com", Mail = "M&M#mail.com",
Mdp = "1234", Mdp = "1234",
Nom = "M&M's", Nom = "M&M's",
Prenom = "Red", Prenom = "Red",
Pseudo = "RedM",
Role = "Modérator" Role = "Modérator"
}, },
new new
{ {
Id = 4L, Pseudo = "Sha",
Mail = "ShaCasca@gmail.com", Mail = "ShaCasca@gmail.com",
Mdp = "1234", Mdp = "1234",
Nom = "Cascarra", Nom = "Cascarra",
Prenom = "Cascarra", Prenom = "Cascarra",
Pseudo = "Sha",
Role = "Admin" Role = "Admin"
}, },
new new
{ {
Id = 5L, Pseudo = "NoaSil",
Mail = "", Mail = "",
Mdp = "1234", Mdp = "1234",
Nom = "Sillard", Nom = "Sillard",
Prenom = "Noa", Prenom = "Noa",
Pseudo = "NoaSil",
Role = "Admin" Role = "Admin"
}); });
}); });
@ -278,7 +262,7 @@ namespace DbContextLib.Migrations
b.HasOne("Entities.UserEntity", null) b.HasOne("Entities.UserEntity", null)
.WithMany() .WithMany()
.HasForeignKey("UserEntityId") .HasForeignKey("UserEntityPseudo")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
}); });
@ -287,7 +271,7 @@ namespace DbContextLib.Migrations
{ {
b.HasOne("Entities.UserEntity", "User") b.HasOne("Entities.UserEntity", "User")
.WithMany("Forms") .WithMany("Forms")
.HasForeignKey("UserEntityId") .HasForeignKey("UserEntityPseudo")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();

@ -33,8 +33,6 @@ namespace DbContextLib.Migrations
name: "UserSet", name: "UserSet",
columns: table => new columns: table => new
{ {
Id = table.Column<long>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Pseudo = table.Column<string>(type: "TEXT", nullable: false), Pseudo = table.Column<string>(type: "TEXT", nullable: false),
Mdp = table.Column<string>(type: "TEXT", nullable: false), Mdp = table.Column<string>(type: "TEXT", nullable: false),
Nom = table.Column<string>(type: "TEXT", nullable: false), Nom = table.Column<string>(type: "TEXT", nullable: false),
@ -44,19 +42,19 @@ namespace DbContextLib.Migrations
}, },
constraints: table => constraints: table =>
{ {
table.PrimaryKey("PK_UserSet", x => x.Id); table.PrimaryKey("PK_UserSet", x => x.Pseudo);
}); });
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "ArticleUserSet", name: "ArticleUserSet",
columns: table => new columns: table => new
{ {
UserEntityId = table.Column<long>(type: "INTEGER", nullable: false), UserEntityPseudo = table.Column<string>(type: "TEXT", nullable: false),
ArticleEntityId = table.Column<long>(type: "INTEGER", nullable: false) ArticleEntityId = table.Column<long>(type: "INTEGER", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
table.PrimaryKey("PK_ArticleUserSet", x => new { x.ArticleEntityId, x.UserEntityId }); table.PrimaryKey("PK_ArticleUserSet", x => new { x.ArticleEntityId, x.UserEntityPseudo });
table.ForeignKey( table.ForeignKey(
name: "FK_ArticleUserSet_ArticleSet_ArticleEntityId", name: "FK_ArticleUserSet_ArticleSet_ArticleEntityId",
column: x => x.ArticleEntityId, column: x => x.ArticleEntityId,
@ -64,10 +62,10 @@ namespace DbContextLib.Migrations
principalColumn: "Id", principalColumn: "Id",
onDelete: ReferentialAction.Cascade); onDelete: ReferentialAction.Cascade);
table.ForeignKey( table.ForeignKey(
name: "FK_ArticleUserSet_UserSet_UserEntityId", name: "FK_ArticleUserSet_UserSet_UserEntityPseudo",
column: x => x.UserEntityId, column: x => x.UserEntityPseudo,
principalTable: "UserSet", principalTable: "UserSet",
principalColumn: "Id", principalColumn: "Pseudo",
onDelete: ReferentialAction.Cascade); onDelete: ReferentialAction.Cascade);
}); });
@ -80,17 +78,16 @@ namespace DbContextLib.Migrations
Theme = table.Column<string>(type: "TEXT", nullable: false), Theme = table.Column<string>(type: "TEXT", nullable: false),
DatePublication = table.Column<string>(type: "TEXT", nullable: false), DatePublication = table.Column<string>(type: "TEXT", nullable: false),
Link = table.Column<string>(type: "TEXT", nullable: false), Link = table.Column<string>(type: "TEXT", nullable: false),
Pseudo = table.Column<string>(type: "TEXT", nullable: false), UserEntityPseudo = table.Column<string>(type: "TEXT", nullable: false)
UserEntityId = table.Column<long>(type: "INTEGER", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
table.PrimaryKey("PK_FormSet", x => x.Id); table.PrimaryKey("PK_FormSet", x => x.Id);
table.ForeignKey( table.ForeignKey(
name: "FK_FormSet_UserSet_UserEntityId", name: "FK_FormSet_UserSet_UserEntityPseudo",
column: x => x.UserEntityId, column: x => x.UserEntityPseudo,
principalTable: "UserSet", principalTable: "UserSet",
principalColumn: "Id", principalColumn: "Pseudo",
onDelete: ReferentialAction.Cascade); onDelete: ReferentialAction.Cascade);
}); });
@ -106,47 +103,47 @@ namespace DbContextLib.Migrations
migrationBuilder.InsertData( migrationBuilder.InsertData(
table: "UserSet", table: "UserSet",
columns: new[] { "Id", "Mail", "Mdp", "Nom", "Prenom", "Pseudo", "Role" }, columns: new[] { "Pseudo", "Mail", "Mdp", "Nom", "Prenom", "Role" },
values: new object[,] values: new object[,]
{ {
{ 1L, "tony@gmail.com", "1234", "Fages", "Tony", "TonyF", "Admin" }, { "NoaSil", "", "1234", "Sillard", "Noa", "Admin" },
{ 2L, "tom@mail.com", "1234", "Smith", "Tom", "TomS", "User" }, { "RedM", "M&M#mail.com", "1234", "M&M's", "Red", "Modérator" },
{ 3L, "M&M#mail.com", "1234", "M&M's", "Red", "RedM", "Modérator" }, { "Sha", "ShaCasca@gmail.com", "1234", "Cascarra", "Cascarra", "Admin" },
{ 4L, "ShaCasca@gmail.com", "1234", "Cascarra", "Cascarra", "Sha", "Admin" }, { "TomS", "tom@mail.com", "1234", "Smith", "Tom", "User" },
{ 5L, "", "1234", "Sillard", "Noa", "NoaSil", "Admin" } { "TonyF", "tony@gmail.com", "1234", "Fages", "Tony", "Admin" }
}); });
migrationBuilder.InsertData( migrationBuilder.InsertData(
table: "ArticleUserSet", table: "ArticleUserSet",
columns: new[] { "ArticleEntityId", "UserEntityId" }, columns: new[] { "ArticleEntityId", "UserEntityPseudo" },
values: new object[,] values: new object[,]
{ {
{ 1L, 1L }, { 1L, "TonyF" },
{ 2L, 2L }, { 2L, "NoaSil" },
{ 2L, 3L }, { 2L, "TomS" },
{ 3L, 1L }, { 3L, "RedM" },
{ 3L, 3L } { 3L, "Sha" }
}); });
migrationBuilder.InsertData( migrationBuilder.InsertData(
table: "FormSet", table: "FormSet",
columns: new[] { "Id", "DatePublication", "Link", "Pseudo", "Theme", "UserEntityId" }, columns: new[] { "Id", "DatePublication", "Link", "Theme", "UserEntityPseudo" },
values: new object[,] values: new object[,]
{ {
{ 1L, "Form 1 Description", "hhtp://form1.com", "Form 1", "", 1L }, { 1L, "Form 1 Description", "hhtp://form1.com", "", "Sha" },
{ 2L, "Form 2 Description", "hhtp://form2.com", "Form 2", "", 2L }, { 2L, "Form 2 Description", "hhtp://form2.com", "", "Sha" },
{ 3L, "Form 3 Description", "hhtp://form3.com", "Form 3", "", 3L } { 3L, "Form 3 Description", "hhtp://form3.com", "", "Sha" }
}); });
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_ArticleUserSet_UserEntityId", name: "IX_ArticleUserSet_UserEntityPseudo",
table: "ArticleUserSet", table: "ArticleUserSet",
column: "UserEntityId"); column: "UserEntityPseudo");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_FormSet_UserEntityId", name: "IX_FormSet_UserEntityPseudo",
table: "FormSet", table: "FormSet",
column: "UserEntityId"); column: "UserEntityPseudo");
} }
/// <inheritdoc /> /// <inheritdoc />

@ -80,12 +80,12 @@ namespace DbContextLib.Migrations
b.Property<long>("ArticleEntityId") b.Property<long>("ArticleEntityId")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
b.Property<long>("UserEntityId") b.Property<string>("UserEntityPseudo")
.HasColumnType("INTEGER"); .HasColumnType("TEXT");
b.HasKey("ArticleEntityId", "UserEntityId"); b.HasKey("ArticleEntityId", "UserEntityPseudo");
b.HasIndex("UserEntityId"); b.HasIndex("UserEntityPseudo");
b.ToTable("ArticleUserSet"); b.ToTable("ArticleUserSet");
@ -93,27 +93,27 @@ namespace DbContextLib.Migrations
new new
{ {
ArticleEntityId = 1L, ArticleEntityId = 1L,
UserEntityId = 1L UserEntityPseudo = "TonyF"
}, },
new new
{ {
ArticleEntityId = 2L, ArticleEntityId = 2L,
UserEntityId = 2L UserEntityPseudo = "NoaSil"
}, },
new new
{ {
ArticleEntityId = 3L, ArticleEntityId = 3L,
UserEntityId = 3L UserEntityPseudo = "Sha"
}, },
new new
{ {
ArticleEntityId = 3L, ArticleEntityId = 3L,
UserEntityId = 1L UserEntityPseudo = "RedM"
}, },
new new
{ {
ArticleEntityId = 2L, ArticleEntityId = 2L,
UserEntityId = 3L UserEntityPseudo = "TomS"
}); });
}); });
@ -131,20 +131,17 @@ namespace DbContextLib.Migrations
.IsRequired() .IsRequired()
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Pseudo") b.Property<string>("Theme")
.IsRequired() .IsRequired()
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Theme") b.Property<string>("UserEntityPseudo")
.IsRequired() .IsRequired()
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<long>("UserEntityId")
.HasColumnType("INTEGER");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("UserEntityId"); b.HasIndex("UserEntityPseudo");
b.ToTable("FormSet"); b.ToTable("FormSet");
@ -154,35 +151,31 @@ namespace DbContextLib.Migrations
Id = 1L, Id = 1L,
DatePublication = "Form 1 Description", DatePublication = "Form 1 Description",
Link = "hhtp://form1.com", Link = "hhtp://form1.com",
Pseudo = "Form 1",
Theme = "", Theme = "",
UserEntityId = 1L UserEntityPseudo = "Sha"
}, },
new new
{ {
Id = 2L, Id = 2L,
DatePublication = "Form 2 Description", DatePublication = "Form 2 Description",
Link = "hhtp://form2.com", Link = "hhtp://form2.com",
Pseudo = "Form 2",
Theme = "", Theme = "",
UserEntityId = 2L UserEntityPseudo = "Sha"
}, },
new new
{ {
Id = 3L, Id = 3L,
DatePublication = "Form 3 Description", DatePublication = "Form 3 Description",
Link = "hhtp://form3.com", Link = "hhtp://form3.com",
Pseudo = "Form 3",
Theme = "", Theme = "",
UserEntityId = 3L UserEntityPseudo = "Sha"
}); });
}); });
modelBuilder.Entity("Entities.UserEntity", b => modelBuilder.Entity("Entities.UserEntity", b =>
{ {
b.Property<long>("Id") b.Property<string>("Pseudo")
.ValueGeneratedOnAdd() .HasColumnType("TEXT");
.HasColumnType("INTEGER");
b.Property<string>("Mail") b.Property<string>("Mail")
.IsRequired() .IsRequired()
@ -200,67 +193,58 @@ namespace DbContextLib.Migrations
.IsRequired() .IsRequired()
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Pseudo")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Role") b.Property<string>("Role")
.IsRequired() .IsRequired()
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.HasKey("Id"); b.HasKey("Pseudo");
b.ToTable("UserSet"); b.ToTable("UserSet");
b.HasData( b.HasData(
new new
{ {
Id = 1L, Pseudo = "TonyF",
Mail = "tony@gmail.com", Mail = "tony@gmail.com",
Mdp = "1234", Mdp = "1234",
Nom = "Fages", Nom = "Fages",
Prenom = "Tony", Prenom = "Tony",
Pseudo = "TonyF",
Role = "Admin" Role = "Admin"
}, },
new new
{ {
Id = 2L, Pseudo = "TomS",
Mail = "tom@mail.com", Mail = "tom@mail.com",
Mdp = "1234", Mdp = "1234",
Nom = "Smith", Nom = "Smith",
Prenom = "Tom", Prenom = "Tom",
Pseudo = "TomS",
Role = "User" Role = "User"
}, },
new new
{ {
Id = 3L, Pseudo = "RedM",
Mail = "M&M#mail.com", Mail = "M&M#mail.com",
Mdp = "1234", Mdp = "1234",
Nom = "M&M's", Nom = "M&M's",
Prenom = "Red", Prenom = "Red",
Pseudo = "RedM",
Role = "Modérator" Role = "Modérator"
}, },
new new
{ {
Id = 4L, Pseudo = "Sha",
Mail = "ShaCasca@gmail.com", Mail = "ShaCasca@gmail.com",
Mdp = "1234", Mdp = "1234",
Nom = "Cascarra", Nom = "Cascarra",
Prenom = "Cascarra", Prenom = "Cascarra",
Pseudo = "Sha",
Role = "Admin" Role = "Admin"
}, },
new new
{ {
Id = 5L, Pseudo = "NoaSil",
Mail = "", Mail = "",
Mdp = "1234", Mdp = "1234",
Nom = "Sillard", Nom = "Sillard",
Prenom = "Noa", Prenom = "Noa",
Pseudo = "NoaSil",
Role = "Admin" Role = "Admin"
}); });
}); });
@ -275,7 +259,7 @@ namespace DbContextLib.Migrations
b.HasOne("Entities.UserEntity", null) b.HasOne("Entities.UserEntity", null)
.WithMany() .WithMany()
.HasForeignKey("UserEntityId") .HasForeignKey("UserEntityPseudo")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
}); });
@ -284,7 +268,7 @@ namespace DbContextLib.Migrations
{ {
b.HasOne("Entities.UserEntity", "User") b.HasOne("Entities.UserEntity", "User")
.WithMany("Forms") .WithMany("Forms")
.HasForeignKey("UserEntityId") .HasForeignKey("UserEntityPseudo")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();

Loading…
Cancel
Save