2023-08-12 20:13:47 +01:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
|
2023-08-13 17:33:54 +01:00
|
|
|
namespace OliverBooth.Data.Blog.Configuration;
|
2023-08-12 20:13:47 +01:00
|
|
|
|
|
|
|
internal sealed class UserConfiguration : IEntityTypeConfiguration<User>
|
|
|
|
{
|
|
|
|
/// <inheritdoc />
|
|
|
|
public void Configure(EntityTypeBuilder<User> builder)
|
|
|
|
{
|
2023-08-13 15:25:25 +01:00
|
|
|
builder.ToTable("User");
|
2023-08-12 20:13:47 +01:00
|
|
|
builder.HasKey(e => e.Id);
|
|
|
|
|
|
|
|
builder.Property(e => e.Id).IsRequired();
|
|
|
|
builder.Property(e => e.DisplayName).HasMaxLength(50).IsRequired();
|
|
|
|
builder.Property(e => e.EmailAddress).HasMaxLength(255).IsRequired();
|
|
|
|
builder.Property(e => e.Password).HasMaxLength(255).IsRequired();
|
|
|
|
builder.Property(e => e.Salt).HasMaxLength(255).IsRequired();
|
|
|
|
builder.Property(e => e.Registered).IsRequired();
|
|
|
|
}
|
|
|
|
}
|