| 12345678910111213141516171819 |
- using Domain.Entities.Developers;
- using Microsoft.EntityFrameworkCore;
- using Microsoft.EntityFrameworkCore.Metadata.Builders;
- namespace Infrastructure.Persistence.Configurations.Developers;
- public class ApiApplicationScopeConfiguration : IEntityTypeConfiguration<ApiApplicationScope>
- {
- public void Configure(EntityTypeBuilder<ApiApplicationScope> builder)
- {
- builder.HasOne(x => x.Application).WithMany(a => a.Scopes).HasForeignKey(x => x.ApplicationID).OnDelete(DeleteBehavior.Cascade);
- builder.HasIndex(x => new { x.ApplicationID, x.Scope }).IsUnique();
- builder.ToTable(nameof(ApiApplicationScope), x => x.HasComment("앱이 요청한 scope 목록"));
- builder.HasKey(x => x.ID);
- builder.Property(x => x.Scope).HasMaxLength(64).IsRequired();
- builder.Property(x => x.CreatedAt).IsRequired();
- }
- }
|