diff --git a/Sources/Api/BDD.db b/Sources/Api/BDD.db new file mode 100644 index 0000000..e69de29 diff --git a/Sources/Dto/Classe/EcurieDTO.cs b/Sources/Dto/Classe/EcurieDTO.cs index c9b2f37..87552cb 100644 --- a/Sources/Dto/Classe/EcurieDTO.cs +++ b/Sources/Dto/Classe/EcurieDTO.cs @@ -9,5 +9,8 @@ namespace Dto.Classe public class EcurieDTO { public string Name { get; set; } + public List Members { get; set; } + public List WaitingsMembers { get; set; } + public PiloteDTO Owner { get; set; } } } diff --git a/Sources/Entity_Framework/BDD.db b/Sources/Entity_Framework/BDD.db index 2e4f481..30720dd 100644 Binary files a/Sources/Entity_Framework/BDD.db and b/Sources/Entity_Framework/BDD.db differ diff --git a/Sources/Entity_Framework/BDDContext.cs b/Sources/Entity_Framework/BDDContext.cs index 1b4c267..b6ecb50 100644 --- a/Sources/Entity_Framework/BDDContext.cs +++ b/Sources/Entity_Framework/BDDContext.cs @@ -155,7 +155,7 @@ namespace Entity_Framework { if (!optionsBuilder.IsConfigured) { - optionsBuilder.UseSqlite($"Data Source=BDD.db"); + optionsBuilder.UseSqlite($"Data Source=..\\Entity_Framework\\BDD.db"); // optionsBuilder.UseSqlite($"Data Source=C:\\Users\\Jolys Enzo\\home\\BUT\\Projet\\Sae4.01\\Projet\\R-Dash_APP\\Entity_Framework\\BDD.db"); //optionsBuilder.UseSqlite($"Data Source=C:\\Users\\zinn1\\Source\\Repos\\Serveur-Api2\\Sources\\Entity_Framework\\BDD.db"); } diff --git a/Sources/Entity_Framework/Migrations/20230317102828_test.Designer.cs b/Sources/Entity_Framework/Migrations/20230322172943_test.Designer.cs similarity index 87% rename from Sources/Entity_Framework/Migrations/20230317102828_test.Designer.cs rename to Sources/Entity_Framework/Migrations/20230322172943_test.Designer.cs index aeb7329..f0da2c9 100644 --- a/Sources/Entity_Framework/Migrations/20230317102828_test.Designer.cs +++ b/Sources/Entity_Framework/Migrations/20230322172943_test.Designer.cs @@ -11,7 +11,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Entity_Framework.Migrations { [DbContext(typeof(BDDContext))] - [Migration("20230317102828_test")] + [Migration("20230322172943_test")] partial class test { /// @@ -100,9 +100,6 @@ namespace Entity_Framework.Migrations .IsRequired() .HasColumnType("TEXT"); - b.Property("IdEcurie") - .HasColumnType("INTEGER"); - b.Property("Password") .IsRequired() .HasColumnType("TEXT"); @@ -116,8 +113,6 @@ namespace Entity_Framework.Migrations b.HasIndex("Email") .IsUnique(); - b.HasIndex("IdEcurie"); - b.HasIndex("Pseudo") .IsUnique(); @@ -182,6 +177,33 @@ namespace Entity_Framework.Migrations b.ToTable("Points"); }); + modelBuilder.Entity("Entity_Framework.Entity.Relations.Relation_Pilote_Ecurie", b => + { + b.Property("IdPilote") + .HasColumnType("INTEGER"); + + b.Property("IdEcurie") + .HasColumnType("INTEGER"); + + b.Property("EcurieId") + .HasColumnType("INTEGER"); + + b.Property("Grade") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("PiloteId") + .HasColumnType("INTEGER"); + + b.HasKey("IdPilote", "IdEcurie"); + + b.HasIndex("EcurieId"); + + b.HasIndex("PiloteId"); + + b.ToTable("RelationEcuriePilote"); + }); + modelBuilder.Entity("Entity_Framework.Entity.Sessions", b => { b.Property("Id") @@ -259,15 +281,6 @@ namespace Entity_Framework.Migrations b.Navigation("Pilote"); }); - modelBuilder.Entity("Entity_Framework.Entity.Pilotes", b => - { - b.HasOne("Entity_Framework.Entity.Ecuries", "Ecurie") - .WithMany("Pilotes") - .HasForeignKey("IdEcurie"); - - b.Navigation("Ecurie"); - }); - modelBuilder.Entity("Entity_Framework.Entity.Points", b => { b.HasOne("Entity_Framework.Entity.Tours", "Tours") @@ -279,6 +292,25 @@ namespace Entity_Framework.Migrations b.Navigation("Tours"); }); + modelBuilder.Entity("Entity_Framework.Entity.Relations.Relation_Pilote_Ecurie", b => + { + b.HasOne("Entity_Framework.Entity.Ecuries", "Ecurie") + .WithMany("PilotesRelation") + .HasForeignKey("EcurieId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Entity_Framework.Entity.Pilotes", "Pilote") + .WithMany("Ecurie") + .HasForeignKey("PiloteId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Ecurie"); + + b.Navigation("Pilote"); + }); + modelBuilder.Entity("Entity_Framework.Entity.Sessions", b => { b.HasOne("Entity_Framework.Entity.Circuits", "Circuit") @@ -316,11 +348,13 @@ namespace Entity_Framework.Migrations modelBuilder.Entity("Entity_Framework.Entity.Ecuries", b => { - b.Navigation("Pilotes"); + b.Navigation("PilotesRelation"); }); modelBuilder.Entity("Entity_Framework.Entity.Pilotes", b => { + b.Navigation("Ecurie"); + b.Navigation("EcuriePropriétaire") .IsRequired(); diff --git a/Sources/Entity_Framework/Migrations/20230317102828_test.cs b/Sources/Entity_Framework/Migrations/20230322172943_test.cs similarity index 82% rename from Sources/Entity_Framework/Migrations/20230317102828_test.cs rename to Sources/Entity_Framework/Migrations/20230322172943_test.cs index 94ddb0e..f801a94 100644 --- a/Sources/Entity_Framework/Migrations/20230317102828_test.cs +++ b/Sources/Entity_Framework/Migrations/20230322172943_test.cs @@ -25,38 +25,38 @@ namespace Entity_Framework.Migrations }); migrationBuilder.CreateTable( - name: "Ecuries", + name: "Pilotes", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), - Name = table.Column(type: "TEXT", nullable: false), - IdPiloteProprietaire = table.Column(type: "INTEGER", nullable: false) + Pseudo = table.Column(type: "TEXT", nullable: false), + Email = table.Column(type: "TEXT", nullable: false), + Password = table.Column(type: "TEXT", nullable: false) }, constraints: table => { - table.PrimaryKey("PK_Ecuries", x => x.Id); + table.PrimaryKey("PK_Pilotes", x => x.Id); }); migrationBuilder.CreateTable( - name: "Pilotes", + name: "Ecuries", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), - Pseudo = table.Column(type: "TEXT", nullable: false), - Email = table.Column(type: "TEXT", nullable: false), - Password = table.Column(type: "TEXT", nullable: false), - IdEcurie = table.Column(type: "INTEGER", nullable: true) + Name = table.Column(type: "TEXT", nullable: false), + IdPiloteProprietaire = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { - table.PrimaryKey("PK_Pilotes", x => x.Id); + table.PrimaryKey("PK_Ecuries", x => x.Id); table.ForeignKey( - name: "FK_Pilotes_Ecuries_IdEcurie", - column: x => x.IdEcurie, - principalTable: "Ecuries", - principalColumn: "Id"); + name: "FK_Ecuries_Pilotes_IdPiloteProprietaire", + column: x => x.IdPiloteProprietaire, + principalTable: "Pilotes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( @@ -108,6 +108,33 @@ namespace Entity_Framework.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "RelationEcuriePilote", + columns: table => new + { + IdPilote = table.Column(type: "INTEGER", nullable: false), + IdEcurie = table.Column(type: "INTEGER", nullable: false), + Grade = table.Column(type: "TEXT", nullable: false), + PiloteId = table.Column(type: "INTEGER", nullable: false), + EcurieId = table.Column(type: "INTEGER", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_RelationEcuriePilote", x => new { x.IdPilote, x.IdEcurie }); + table.ForeignKey( + name: "FK_RelationEcuriePilote_Ecuries_EcurieId", + column: x => x.EcurieId, + principalTable: "Ecuries", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_RelationEcuriePilote_Pilotes_PiloteId", + column: x => x.PiloteId, + principalTable: "Pilotes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "Tours", columns: table => new @@ -166,8 +193,8 @@ namespace Entity_Framework.Migrations migrationBuilder.InsertData( table: "Pilotes", - columns: new[] { "Id", "Email", "IdEcurie", "Password", "Pseudo" }, - values: new object[] { 1, "test@gmail.com", null, "7NcYcNGWMxapfjrDQIyYNa2M8PPBvHA1J8MCZVNPda4=", "test_PILOTE" }); + columns: new[] { "Id", "Email", "Password", "Pseudo" }, + values: new object[] { 1, "test@gmail.com", "7NcYcNGWMxapfjrDQIyYNa2M8PPBvHA1J8MCZVNPda4=", "test_PILOTE" }); migrationBuilder.CreateIndex( name: "IX_Circuits_Name", @@ -199,11 +226,6 @@ namespace Entity_Framework.Migrations column: "Email", unique: true); - migrationBuilder.CreateIndex( - name: "IX_Pilotes_IdEcurie", - table: "Pilotes", - column: "IdEcurie"); - migrationBuilder.CreateIndex( name: "IX_Pilotes_Pseudo", table: "Pilotes", @@ -215,6 +237,16 @@ namespace Entity_Framework.Migrations table: "Points", column: "IdTours"); + migrationBuilder.CreateIndex( + name: "IX_RelationEcuriePilote_EcurieId", + table: "RelationEcuriePilote", + column: "EcurieId"); + + migrationBuilder.CreateIndex( + name: "IX_RelationEcuriePilote_PiloteId", + table: "RelationEcuriePilote", + column: "PiloteId"); + migrationBuilder.CreateIndex( name: "IX_Sessions_IdCircuit", table: "Sessions", @@ -229,32 +261,26 @@ namespace Entity_Framework.Migrations name: "IX_Tours_IdSession", table: "Tours", column: "IdSession"); - - migrationBuilder.AddForeignKey( - name: "FK_Ecuries_Pilotes_IdPiloteProprietaire", - table: "Ecuries", - column: "IdPiloteProprietaire", - principalTable: "Pilotes", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); } /// protected override void Down(MigrationBuilder migrationBuilder) { - migrationBuilder.DropForeignKey( - name: "FK_Ecuries_Pilotes_IdPiloteProprietaire", - table: "Ecuries"); - migrationBuilder.DropTable( name: "Images"); migrationBuilder.DropTable( name: "Points"); + migrationBuilder.DropTable( + name: "RelationEcuriePilote"); + migrationBuilder.DropTable( name: "Tours"); + migrationBuilder.DropTable( + name: "Ecuries"); + migrationBuilder.DropTable( name: "Sessions"); @@ -263,9 +289,6 @@ namespace Entity_Framework.Migrations migrationBuilder.DropTable( name: "Pilotes"); - - migrationBuilder.DropTable( - name: "Ecuries"); } } } diff --git a/Sources/Entity_Framework/Migrations/20230322173202_test2.Designer.cs b/Sources/Entity_Framework/Migrations/20230322173202_test2.Designer.cs new file mode 100644 index 0000000..913f7a3 --- /dev/null +++ b/Sources/Entity_Framework/Migrations/20230322173202_test2.Designer.cs @@ -0,0 +1,379 @@ +// +using System; +using Entity_Framework; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Entity_Framework.Migrations +{ + [DbContext(typeof(BDDContext))] + [Migration("20230322173202_test2")] + partial class test2 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "7.0.3"); + + modelBuilder.Entity("Entity_Framework.Entity.Circuits", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Circuits"); + + b.HasData( + new + { + Id = 1, + Name = "test_CIRCUIT" + }); + }); + + modelBuilder.Entity("Entity_Framework.Entity.Ecuries", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("IdPiloteProprietaire") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("IdPiloteProprietaire") + .IsUnique(); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Ecuries"); + }); + + modelBuilder.Entity("Entity_Framework.Entity.Images", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Base64") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("IdPilote") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("IdPilote") + .IsUnique(); + + b.ToTable("Images"); + }); + + modelBuilder.Entity("Entity_Framework.Entity.Pilotes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Email") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Password") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Pseudo") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("Email") + .IsUnique(); + + b.HasIndex("Pseudo") + .IsUnique(); + + b.ToTable("Pilotes"); + + b.HasData( + new + { + Id = 1, + Email = "test@gmail.com", + Password = "7NcYcNGWMxapfjrDQIyYNa2M8PPBvHA1J8MCZVNPda4=", + Pseudo = "test_PILOTE" + }); + }); + + modelBuilder.Entity("Entity_Framework.Entity.Points", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("A_Steer") + .HasColumnType("REAL"); + + b.Property("Distance") + .HasColumnType("REAL"); + + b.Property("G_Lat") + .HasColumnType("REAL"); + + b.Property("G_Lon") + .HasColumnType("REAL"); + + b.Property("IdTours") + .HasColumnType("INTEGER"); + + b.Property("Latitude") + .HasColumnType("REAL"); + + b.Property("Longitude") + .HasColumnType("REAL"); + + b.Property("NGearASCII") + .HasColumnType("REAL"); + + b.Property("P_BreakF") + .HasColumnType("REAL"); + + b.Property("R_Pedal") + .HasColumnType("REAL"); + + b.Property("Timer") + .HasColumnType("REAL"); + + b.Property("V_Car") + .HasColumnType("REAL"); + + b.HasKey("Id"); + + b.HasIndex("IdTours"); + + b.ToTable("Points"); + }); + + modelBuilder.Entity("Entity_Framework.Entity.Relations.Relation_Pilote_Ecurie", b => + { + b.Property("IdPilote") + .HasColumnType("INTEGER"); + + b.Property("IdEcurie") + .HasColumnType("INTEGER"); + + b.Property("EcurieId") + .HasColumnType("INTEGER"); + + b.Property("Grade") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("PiloteId") + .HasColumnType("INTEGER"); + + b.HasKey("IdPilote", "IdEcurie"); + + b.HasIndex("EcurieId"); + + b.HasIndex("PiloteId"); + + b.ToTable("RelationEcuriePilote"); + }); + + modelBuilder.Entity("Entity_Framework.Entity.Sessions", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Date") + .HasColumnType("TEXT"); + + b.Property("IdCircuit") + .HasColumnType("INTEGER"); + + b.Property("IdPilote") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Type") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("IdCircuit"); + + b.HasIndex("IdPilote"); + + b.ToTable("Sessions"); + }); + + modelBuilder.Entity("Entity_Framework.Entity.Tours", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("IdSession") + .HasColumnType("INTEGER"); + + b.Property("Numero") + .HasColumnType("INTEGER"); + + b.Property("Temps") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("IdSession"); + + b.ToTable("Tours"); + }); + + modelBuilder.Entity("Entity_Framework.Entity.Ecuries", b => + { + b.HasOne("Entity_Framework.Entity.Pilotes", "PiloteProprietaire") + .WithOne("EcuriePropriétaire") + .HasForeignKey("Entity_Framework.Entity.Ecuries", "IdPiloteProprietaire") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PiloteProprietaire"); + }); + + modelBuilder.Entity("Entity_Framework.Entity.Images", b => + { + b.HasOne("Entity_Framework.Entity.Pilotes", "Pilote") + .WithOne("Image") + .HasForeignKey("Entity_Framework.Entity.Images", "IdPilote") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Pilote"); + }); + + modelBuilder.Entity("Entity_Framework.Entity.Points", b => + { + b.HasOne("Entity_Framework.Entity.Tours", "Tours") + .WithMany("Points") + .HasForeignKey("IdTours") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Tours"); + }); + + modelBuilder.Entity("Entity_Framework.Entity.Relations.Relation_Pilote_Ecurie", b => + { + b.HasOne("Entity_Framework.Entity.Ecuries", "Ecurie") + .WithMany("PilotesRelation") + .HasForeignKey("EcurieId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Entity_Framework.Entity.Pilotes", "Pilote") + .WithMany("Ecurie") + .HasForeignKey("PiloteId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Ecurie"); + + b.Navigation("Pilote"); + }); + + modelBuilder.Entity("Entity_Framework.Entity.Sessions", b => + { + b.HasOne("Entity_Framework.Entity.Circuits", "Circuit") + .WithMany("Course") + .HasForeignKey("IdCircuit") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Entity_Framework.Entity.Pilotes", "Pilote") + .WithMany("Sessions") + .HasForeignKey("IdPilote") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Circuit"); + + b.Navigation("Pilote"); + }); + + modelBuilder.Entity("Entity_Framework.Entity.Tours", b => + { + b.HasOne("Entity_Framework.Entity.Sessions", "Session") + .WithMany("Tours") + .HasForeignKey("IdSession") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Session"); + }); + + modelBuilder.Entity("Entity_Framework.Entity.Circuits", b => + { + b.Navigation("Course"); + }); + + modelBuilder.Entity("Entity_Framework.Entity.Ecuries", b => + { + b.Navigation("PilotesRelation"); + }); + + modelBuilder.Entity("Entity_Framework.Entity.Pilotes", b => + { + b.Navigation("Ecurie"); + + b.Navigation("EcuriePropriétaire") + .IsRequired(); + + b.Navigation("Image") + .IsRequired(); + + b.Navigation("Sessions"); + }); + + modelBuilder.Entity("Entity_Framework.Entity.Sessions", b => + { + b.Navigation("Tours"); + }); + + modelBuilder.Entity("Entity_Framework.Entity.Tours", b => + { + b.Navigation("Points"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Sources/Entity_Framework/Migrations/20230322173202_test2.cs b/Sources/Entity_Framework/Migrations/20230322173202_test2.cs new file mode 100644 index 0000000..9227a93 --- /dev/null +++ b/Sources/Entity_Framework/Migrations/20230322173202_test2.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Entity_Framework.Migrations +{ + /// + public partial class test2 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/Sources/Entity_Framework/Migrations/BDDContextModelSnapshot.cs b/Sources/Entity_Framework/Migrations/BDDContextModelSnapshot.cs index ac2d2aa..cb7120f 100644 --- a/Sources/Entity_Framework/Migrations/BDDContextModelSnapshot.cs +++ b/Sources/Entity_Framework/Migrations/BDDContextModelSnapshot.cs @@ -97,9 +97,6 @@ namespace Entity_Framework.Migrations .IsRequired() .HasColumnType("TEXT"); - b.Property("IdEcurie") - .HasColumnType("INTEGER"); - b.Property("Password") .IsRequired() .HasColumnType("TEXT"); @@ -113,8 +110,6 @@ namespace Entity_Framework.Migrations b.HasIndex("Email") .IsUnique(); - b.HasIndex("IdEcurie"); - b.HasIndex("Pseudo") .IsUnique(); @@ -179,6 +174,33 @@ namespace Entity_Framework.Migrations b.ToTable("Points"); }); + modelBuilder.Entity("Entity_Framework.Entity.Relations.Relation_Pilote_Ecurie", b => + { + b.Property("IdPilote") + .HasColumnType("INTEGER"); + + b.Property("IdEcurie") + .HasColumnType("INTEGER"); + + b.Property("EcurieId") + .HasColumnType("INTEGER"); + + b.Property("Grade") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("PiloteId") + .HasColumnType("INTEGER"); + + b.HasKey("IdPilote", "IdEcurie"); + + b.HasIndex("EcurieId"); + + b.HasIndex("PiloteId"); + + b.ToTable("RelationEcuriePilote"); + }); + modelBuilder.Entity("Entity_Framework.Entity.Sessions", b => { b.Property("Id") @@ -256,15 +278,6 @@ namespace Entity_Framework.Migrations b.Navigation("Pilote"); }); - modelBuilder.Entity("Entity_Framework.Entity.Pilotes", b => - { - b.HasOne("Entity_Framework.Entity.Ecuries", "Ecurie") - .WithMany("Pilotes") - .HasForeignKey("IdEcurie"); - - b.Navigation("Ecurie"); - }); - modelBuilder.Entity("Entity_Framework.Entity.Points", b => { b.HasOne("Entity_Framework.Entity.Tours", "Tours") @@ -276,6 +289,25 @@ namespace Entity_Framework.Migrations b.Navigation("Tours"); }); + modelBuilder.Entity("Entity_Framework.Entity.Relations.Relation_Pilote_Ecurie", b => + { + b.HasOne("Entity_Framework.Entity.Ecuries", "Ecurie") + .WithMany("PilotesRelation") + .HasForeignKey("EcurieId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Entity_Framework.Entity.Pilotes", "Pilote") + .WithMany("Ecurie") + .HasForeignKey("PiloteId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Ecurie"); + + b.Navigation("Pilote"); + }); + modelBuilder.Entity("Entity_Framework.Entity.Sessions", b => { b.HasOne("Entity_Framework.Entity.Circuits", "Circuit") @@ -313,11 +345,13 @@ namespace Entity_Framework.Migrations modelBuilder.Entity("Entity_Framework.Entity.Ecuries", b => { - b.Navigation("Pilotes"); + b.Navigation("PilotesRelation"); }); modelBuilder.Entity("Entity_Framework.Entity.Pilotes", b => { + b.Navigation("Ecurie"); + b.Navigation("EcuriePropriétaire") .IsRequired();