Correction PDF
This commit is contained in:
@@ -23,22 +23,13 @@ public partial class HelloFreshContext : DbContext
|
||||
|
||||
public virtual DbSet<SavingRecette> SavingRecettes { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263.
|
||||
=> optionsBuilder.UseSqlServer("Server=217.154.116.43;Database=HelloFresh;User Id=sa;Password=Mf33ksTRLrPKSqQ4cTXitgiSN6BPBt89;TrustServerCertificate=True;");
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<HistoriqueRecette>(entity =>
|
||||
{
|
||||
entity.Property(e => e.Id).HasColumnName("id");
|
||||
// Map DateOnly -> date SQL
|
||||
entity.Property(e => e.DateHistorique)
|
||||
.HasConversion(
|
||||
v => v.ToDateTime(TimeOnly.MinValue), // vers SQL
|
||||
v => DateOnly.FromDateTime(v) // depuis SQL
|
||||
)
|
||||
.HasColumnType("date");
|
||||
entity.Property(e => e.DateHistorique).HasColumnName("dateHistorique");
|
||||
entity.Property(e => e.RecetteId).HasColumnName("recetteId");
|
||||
entity.Property(e => e.UserId).HasColumnName("userId");
|
||||
});
|
||||
@@ -47,6 +38,7 @@ public partial class HelloFreshContext : DbContext
|
||||
{
|
||||
entity.Property(e => e.Id).HasColumnName("id");
|
||||
entity.Property(e => e.NameOwnedIngredients).HasColumnName("nameOwnedIngredients");
|
||||
entity.Property(e => e.UserId).HasColumnName("userId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Recette>(entity =>
|
||||
|
||||
@@ -7,7 +7,7 @@ public partial class HistoriqueRecette
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string RecetteId { get; set; } = ""; // <-- string pour matcher Recette.Id
|
||||
public string RecetteId { get; set; } = null!;
|
||||
|
||||
public int UserId { get; set; }
|
||||
|
||||
|
||||
@@ -8,4 +8,6 @@ public partial class Ingredient
|
||||
public int Id { get; set; }
|
||||
|
||||
public string NameOwnedIngredients { get; set; } = null!;
|
||||
|
||||
public int UserId { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user