| 1234567891011121314151617181920 |
- using Domain.Entities.Developers;
- using Microsoft.EntityFrameworkCore;
- using Microsoft.EntityFrameworkCore.Metadata.Builders;
- namespace Infrastructure.Persistence.Configurations.Developers;
- public class ApiRateLimitConfiguration : IEntityTypeConfiguration<ApiRateLimit>
- {
- public void Configure(EntityTypeBuilder<ApiRateLimit> builder)
- {
- builder.HasOne(x => x.Application).WithMany().HasForeignKey(x => x.ApplicationID).OnDelete(DeleteBehavior.Cascade);
- builder.HasIndex(x => x.ApplicationID).IsUnique();
- builder.ToTable(nameof(ApiRateLimit), x => x.HasComment("앱별 Rate Limit override"));
- builder.HasKey(x => x.ID);
- builder.Property(x => x.LimitPerMinute).IsRequired();
- builder.Property(x => x.CreatedAt).IsRequired();
- builder.Property(x => x.UpdatedAt).IsRequired();
- }
- }
|