SPMS_API/SPMS.Infrastructure/Persistence/Configurations/ServiceIpConfiguration.cs
SEAN cfce5ca8b8 feat: Domain Entity 정의 및 DB 스키마 구축 (#8)
- 12개 Domain Entity 클래스 정의 (DB_Schema.md 기반)
- 12개 EF Core Fluent API Configuration 구현
- AppDbContext에 DbSet 12개 등록 및 Configuration 자동 적용
- Soft Delete 글로벌 쿼리 필터 적용 (Service, Admin, Message)
- DesignTimeDbContextFactory 추가 (EF Core CLI 지원)
- InitialCreate 마이그레이션 생성 및 spms_dev DB 적용 완료
- .gitignore에 Documents/, CLAUDE.md, TASKS.md, .mcp.json 추가

Closes #8
2026-02-09 11:46:33 +09:00

25 lines
772 B
C#

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using SPMS.Domain.Entities;
namespace SPMS.Infrastructure.Persistence.Configurations;
public class ServiceIpConfiguration : IEntityTypeConfiguration<ServiceIp>
{
public void Configure(EntityTypeBuilder<ServiceIp> builder)
{
builder.ToTable("ServiceIp");
builder.HasKey(e => e.Id);
builder.Property(e => e.Id).ValueGeneratedOnAdd();
builder.Property(e => e.ServiceId).IsRequired();
builder.Property(e => e.IpAddress).HasMaxLength(45).IsRequired();
builder.HasOne(e => e.Service)
.WithMany(s => s.ServiceIps)
.HasForeignKey(e => e.ServiceId)
.OnDelete(DeleteBehavior.Cascade);
}
}