26b29d169e
- Directory.Packages.props and Directory.Build.props for central package management - TemplateEntity, ProviderEntity, ProviderUsageEntity (internal to DAL.EF) - TemplateEntityConfiguration: composite unique index (service_name, key, language_code), Variables as JSON column - ProviderEntityConfiguration: settings stored as jsonb, index on (service_name, priority) - ProviderUsageEntityConfiguration: composite unique index (provider_id, date) - All entities map Id column explicitly as 'id' (snake_case) - NotificationDbContext with ApplyConfigurationsFromAssembly Ref: IT-628 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
22 lines
709 B
C#
22 lines
709 B
C#
using HrynCo.NotificationService.DAL.EF.Entities;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace HrynCo.NotificationService.DAL.EF;
|
|
|
|
public class NotificationDbContext : DbContext
|
|
{
|
|
public NotificationDbContext(DbContextOptions<NotificationDbContext> options)
|
|
: base(options)
|
|
{
|
|
}
|
|
|
|
internal DbSet<TemplateEntity> Templates => Set<TemplateEntity>();
|
|
internal DbSet<ProviderEntity> Providers => Set<ProviderEntity>();
|
|
internal DbSet<ProviderUsageEntity> ProviderUsage => Set<ProviderUsageEntity>();
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder.ApplyConfigurationsFromAssembly(typeof(NotificationDbContext).Assembly);
|
|
}
|
|
}
|