Files
JudoWeb/API/Database/ApplicationDbContext.cs
Jonas 9128b199e9 Switch AltersGruppe ID to ULID and add config
Changed AltersGruppe model ID from int to string and now generates ULID automatically. Added AltersGruppeConfiguration for EF Core mapping. Updated ApplicationDbContext to apply configurations from assembly. Removed obsolete migration files and database artifacts. Added Ulid package dependency.
2025-12-07 19:48:47 +01:00

22 lines
597 B
C#

using API.Models.Internal.Altersgruppen;
using Microsoft.EntityFrameworkCore;
namespace API.Database
{
public class ApplicationDbContext : DbContext
{
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options)
{
}
public DbSet<AltersGruppe> Altersgruppen { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.ApplyConfigurationsFromAssembly(typeof(ApplicationDbContext).Assembly);
}
}
}