826eac1372
1. Separate configuration files 2. Remove commented code 3. Improve entity configurations (constraints, indexes, relationships)
28 lines
738 B
C#
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());
|
|
}
|
|
}
|
|
}
|