2023-08-12 19:13:47 +00:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
|
2023-08-13 16:33:54 +00:00
|
|
|
namespace OliverBooth.Data.Blog.Configuration;
|
2023-08-12 19:13:47 +00:00
|
|
|
|
|
|
|
internal sealed class UserConfiguration : IEntityTypeConfiguration<User>
|
|
|
|
{
|
|
|
|
/// <inheritdoc />
|
|
|
|
public void Configure(EntityTypeBuilder<User> builder)
|
|
|
|
{
|
2023-08-13 14:25:25 +00:00
|
|
|
builder.ToTable("User");
|
2023-08-12 19:13:47 +00: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();
|
|
|
|
}
|
|
|
|
}
|