using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore;
using MS.Entities.AuthService_Models;
using System;
using System.Collections.Generic;
using System.Text;

namespace MS.DbContexts.AuthService
{
    public class AspNetUsersMap : IEntityTypeConfiguration<AspNetUsers>
    {
        public void Configure(EntityTypeBuilder<AspNetUsers> entity)
        {
            entity.HasIndex(e => e.UserName)
                    .HasName("AspNetUsers_UserNameIndex")
                    .IsUnique();

            entity.Property(e => e.Id).HasMaxLength(128);

            entity.Property(e => e.Alias).HasMaxLength(50);

            entity.Property(e => e.Email).HasMaxLength(256);

            entity.Property(e => e.UserName)
                .IsRequired()
                .HasMaxLength(256);
        }
    }
}
