Files
webdoorcreator/WebDoorCreator.Data/UserConfiguration.cs
T
2023-03-08 17:23:14 +01:00

44 lines
1.5 KiB
C#

using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection.Emit;
namespace WebDoorCreator.Data
{
public class UserConfiguration : IEntityTypeConfiguration<IdentityUser>
{
#region Public Methods
public void Configure(EntityTypeBuilder<IdentityUser> builder)
{
var hasher = new PasswordHasher<IdentityUser>();
// inizializzazione dei valori di default x USER
builder.HasData(
new IdentityUser
{
UserName = "zaccaria.majid@egalware.com",
Email = "zaccaria.majid@egalware.com",
NormalizedEmail = "ZACCARIA.MAJID@EGALWARE.COM",
EmailConfirmed = true,
PasswordHash = hasher.HashPassword(null, "th1sIsTh3R1vrOfThNgt98"),
},
new IdentityUser
{
UserName = "samuele.locatelli@egalware.com",
Email = "samuele.locatelli@egalware.com",
NormalizedEmail = "SAMUELE.LOCATELLI@EGALWARE.COM",
EmailConfirmed = true,
PasswordHash = hasher.HashPassword(null, "th1sIsTh3R1vrOfThNgt96"),
});
}
#endregion Public Methods
}
}