| 123456789101112131415161718192021222324 |
- using Domain.Entities.Developers;
- using Microsoft.EntityFrameworkCore;
- using Microsoft.EntityFrameworkCore.Metadata.Builders;
- namespace Infrastructure.Persistence.Configurations.Developers;
- public class ApiApplicationConfiguration : IEntityTypeConfiguration<ApiApplication>
- {
- public void Configure(EntityTypeBuilder<ApiApplication> builder)
- {
- builder.HasOne(x => x.Owner).WithMany().HasForeignKey(x => x.OwnerMemberID).OnDelete(DeleteBehavior.Cascade);
- builder.HasIndex(x => x.OwnerMemberID);
- builder.HasIndex(x => x.Status);
- builder.ToTable(nameof(ApiApplication), x => x.HasComment("개발자 API 앱"));
- builder.HasKey(x => x.ID);
- builder.Property(x => x.Name).HasMaxLength(100).IsRequired();
- builder.Property(x => x.Description).HasMaxLength(500);
- builder.Property(x => x.HomepageUrl).HasMaxLength(500);
- builder.Property(x => x.LogoPath).HasMaxLength(500);
- builder.Property(x => x.Status).HasConversion<int>().IsRequired();
- builder.Property(x => x.CreatedAt).IsRequired();
- }
- }
|