30 lines
881 B
C#
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);
|
|
}
|
|
} |