- Tag 엔티티 생성 (ServiceId, Name, Description, CreatedAt, CreatedBy) - ITagRepository 인터페이스 및 TagRepository 구현 - TagConfiguration: Unique Index (ServiceId, Name), FK Restrict - Service.TagList Navigation 추가 - ErrorCodes에 Tag 에러코드 4종 추가 (191~194) - AppDbContext DbSet<Tag>, DI 등록 - EF Core Migration AddTagTable 생성 및 적용 Closes #243
36 lines
1.4 KiB
C#
36 lines
1.4 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using SPMS.Domain.Entities;
|
|
|
|
namespace SPMS.Infrastructure;
|
|
|
|
public class AppDbContext : DbContext
|
|
{
|
|
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options)
|
|
{
|
|
}
|
|
|
|
public DbSet<Service> Services => Set<Service>();
|
|
public DbSet<ServiceIp> ServiceIps => Set<ServiceIp>();
|
|
public DbSet<Admin> Admins => Set<Admin>();
|
|
public DbSet<Device> Devices => Set<Device>();
|
|
public DbSet<Message> Messages => Set<Message>();
|
|
public DbSet<FileEntity> Files => Set<FileEntity>();
|
|
public DbSet<PushSendLog> PushSendLogs => Set<PushSendLog>();
|
|
public DbSet<PushOpenLog> PushOpenLogs => Set<PushOpenLog>();
|
|
public DbSet<DailyStat> DailyStats => Set<DailyStat>();
|
|
public DbSet<WebhookLog> WebhookLogs => Set<WebhookLog>();
|
|
public DbSet<SystemLog> SystemLogs => Set<SystemLog>();
|
|
public DbSet<Payment> Payments => Set<Payment>();
|
|
public DbSet<Notice> Notices => Set<Notice>();
|
|
public DbSet<Banner> Banners => Set<Banner>();
|
|
public DbSet<Faq> Faqs => Set<Faq>();
|
|
public DbSet<AppConfig> AppConfigs => Set<AppConfig>();
|
|
public DbSet<Tag> Tags => Set<Tag>();
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
base.OnModelCreating(modelBuilder);
|
|
modelBuilder.ApplyConfigurationsFromAssembly(typeof(AppDbContext).Assembly);
|
|
}
|
|
}
|