Files
mic-check/src/api/MicCheck.Api/Data/Configurations/IdentityTraitConfiguration.cs
2026-06-10 13:06:55 -07:00

18 lines
584 B
C#
Executable File

using MicCheck.Api.Identities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace MicCheck.Api.Data.Configurations;
public class IdentityTraitConfiguration : IEntityTypeConfiguration<IdentityTrait>
{
public void Configure(EntityTypeBuilder<IdentityTrait> builder)
{
builder.HasKey(t => t.Id);
builder.Property(t => t.Key).HasMaxLength(200).IsRequired();
builder.Property(t => t.Value).HasMaxLength(2_000).IsRequired();
builder.HasIndex(t => new { t.IdentityId, t.Key }).IsUnique();
}
}