Correction PDF

This commit is contained in:
2025-09-16 22:20:21 +02:00
parent d9fca86145
commit 41bd8254e7
17 changed files with 591 additions and 110 deletions

View File

@@ -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 =>

View File

@@ -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; }

View File

@@ -8,4 +8,6 @@ public partial class Ingredient
public int Id { get; set; }
public string NameOwnedIngredients { get; set; } = null!;
public int UserId { get; set; }
}