oliverbooth.dev/OliverBooth.Blog/Data/Configuration/UserConfiguration.cs
Oliver Booth e8bc50bbdf
refactor: move blog to separate app
I'd ideally like to keep the blog. subdomain the same, and while there are a few ways to achieve this it is much simpler to just dedicate a separate application for the subdomain.

This change also adjusts the webhost builder extensions to default to ports 443/80, and each app now explicitly sets the port it needs.
2023-08-12 20:13:47 +01:00

22 lines
845 B
C#

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace OliverBooth.Blog.Data.Configuration;
internal sealed class UserConfiguration : IEntityTypeConfiguration<User>
{
/// <inheritdoc />
public void Configure(EntityTypeBuilder<User> builder)
{
RelationalEntityTypeBuilderExtensions.ToTable((EntityTypeBuilder)builder, "User");
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();
}
}