Files
chapter-organizer/Data/AppDbContext.cs
T
poprhythm 826eac1372 Database improvement
1.  Separate configuration files
2.  Remove commented code
3.  Improve entity configurations (constraints, indexes, relationships)
2025-12-04 08:09:01 -05:00

28 lines
738 B
C#

using System.Reflection;
using Core.Entities;
using Microsoft.EntityFrameworkCore;
namespace Data
{
public class AppDbContext : DbContext
{
public DbSet<EventDefinition> Events { get; set; }
public DbSet<Student> Students { get; set; }
public DbSet<Team> Teams { get; set; }
public DbSet<StudentEventRanking> StudentEventRanking { get; set; }
public AppDbContext()
{
}
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly());
}
}
}