Files
imprink/src/Imprink.Infrastructure/Configuration/Users/ApplicationUserConfiguration.cs
2025-06-03 18:24:40 +03:00

30 lines
881 B
C#

using Imprink.Domain.Entities.Users;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Imprink.Infrastructure.Configuration.Users;
public class ApplicationUserConfiguration : IEntityTypeConfiguration<ApplicationUser>
{
public void Configure(EntityTypeBuilder<ApplicationUser> builder)
{
builder.Property(u => u.FirstName)
.HasMaxLength(100);
builder.Property(u => u.LastName)
.HasMaxLength(100);
builder.Property(u => u.ProfileImageUrl)
.HasMaxLength(500);
builder.Property(u => u.CreatedAt)
.IsRequired()
.HasDefaultValueSql("GETUTCDATE()");
builder.Property(u => u.LastLoginAt)
.HasDefaultValueSql("GETUTCDATE()");
builder.Property(u => u.IsActive)
.HasDefaultValue(true);
}
}