|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
using Entity_Framework.Entity;
|
|
|
|
|
using Entity_Framework.Entity.Relations;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Reflection.Emit;
|
|
|
|
@ -51,10 +52,11 @@ namespace Entity_Framework
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Relation avec pilotes
|
|
|
|
|
/*
|
|
|
|
|
modelBuilder.Entity<Ecuries>().HasMany(e => e.Pilotes)
|
|
|
|
|
.WithOne(e => e.Ecurie)
|
|
|
|
|
.HasForeignKey(e => e.IdEcurie)
|
|
|
|
|
.IsRequired(false);
|
|
|
|
|
.IsRequired(false);*/
|
|
|
|
|
// -------------------------------------------------------------------//
|
|
|
|
|
// Tables Circuits
|
|
|
|
|
|
|
|
|
@ -117,6 +119,10 @@ namespace Entity_Framework
|
|
|
|
|
modelBuilder.Entity<Images>().Property(e => e.Id)
|
|
|
|
|
.ValueGeneratedOnAdd();
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------//
|
|
|
|
|
// Tables Relation_Ecurie_Pilote
|
|
|
|
|
modelBuilder.Entity<Relation_Pilote_Ecurie>().HasKey(e => new { e.IdPilote, e.IdEcurie });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------ STUB ------------------------------------ //
|
|
|
|
@ -142,6 +148,7 @@ namespace Entity_Framework
|
|
|
|
|
public DbSet<Points> Points { get; set; }
|
|
|
|
|
public DbSet<Tours> Tours { get; set; }
|
|
|
|
|
public DbSet<Images> Images { get; set; }
|
|
|
|
|
public DbSet<Relation_Pilote_Ecurie> RelationEcuriePilote { get; set; }
|
|
|
|
|
|
|
|
|
|
// BDD
|
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
|
|
|