Files
Heimdall/src/Heimdall.Infrastructure/Data/Configurations/LoginChallengeConfiguration.cs
T

19 lines
750 B
C#
Raw Normal View History

using Heimdall.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Heimdall.Infrastructure.Identity;
namespace Heimdall.Infrastructure.Data.Configurations;
public class LoginChallengeConfiguration : IEntityTypeConfiguration<LoginChallenge>
{
public void Configure(EntityTypeBuilder<LoginChallenge> builder)
{
builder.ToTable("login_challenges");
builder.HasKey(x => x.Id);
builder.Property(x => x.Id).HasMaxLength(64);
builder.Property(x => x.SecurityStamp).HasMaxLength(256);
builder.HasIndex(x => x.ExpiresAt);
builder.HasOne<IdentityAppUser>().WithMany().HasForeignKey(x => x.UserId).OnDelete(DeleteBehavior.Cascade);
}
}