From f2d6300d72ce3052fee940f50662ea1b3bef4269 Mon Sep 17 00:00:00 2001 From: "soroush.asadi" Date: Mon, 1 Jun 2026 08:00:54 +0330 Subject: [PATCH] Fix: rename Data/ to Database/ to avoid gitignore collision .gitignore has '/data' which Windows git (case-insensitive) silently matched '/Data/', so AppDbContext.cs was never committed and the Docker build (Linux, case-sensitive) failed with CS0234 'Data' not found. Renaming the directory to 'Database/' sidesteps the collision. Co-Authored-By: Claude Sonnet 4.6 --- Database/AppDbContext.cs | 21 +++++++++++++++++++++ Program.cs | 2 +- Services/ContentService.cs | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 Database/AppDbContext.cs diff --git a/Database/AppDbContext.cs b/Database/AppDbContext.cs new file mode 100644 index 0000000..1ddbc06 --- /dev/null +++ b/Database/AppDbContext.cs @@ -0,0 +1,21 @@ +using Microsoft.EntityFrameworkCore; +using SoroushAsadi.Models; + +namespace SoroushAsadi.Database; + +public class AppDbContext(DbContextOptions options) : DbContext(options) +{ + public DbSet ContentSections => Set(); + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity(e => + { + e.ToTable("sections"); + e.HasKey(x => x.Key); + e.Property(x => x.Key).HasColumnName("key"); + e.Property(x => x.DataJson).HasColumnName("data"); + e.Property(x => x.UpdatedAt).HasColumnName("updated_at"); + }); + } +} diff --git a/Program.cs b/Program.cs index 2eea0ae..cce72c3 100644 --- a/Program.cs +++ b/Program.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.EntityFrameworkCore; -using SoroushAsadi.Data; +using SoroushAsadi.Database; using SoroushAsadi.Services; var builder = WebApplication.CreateBuilder(args); diff --git a/Services/ContentService.cs b/Services/ContentService.cs index 73010ce..26a9c54 100644 --- a/Services/ContentService.cs +++ b/Services/ContentService.cs @@ -1,6 +1,6 @@ using System.Text.Json; using System.Text.Json.Nodes; -using SoroushAsadi.Data; +using SoroushAsadi.Database; namespace SoroushAsadi.Services;