Files
2026-08-05 21:15:14 +03:00

56 lines
2.1 KiB
C#
Executable File

// using Bogus;
// using Domain.Entities;
// using Microsoft.AspNetCore.Identity;
// using Microsoft.EntityFrameworkCore;
// using Microsoft.EntityFrameworkCore.Metadata.Builders;
// namespace Auth.Domain.Configuration;
// public class UserConfiguration : IEntityTypeConfiguration<AppUser>
// {
// private readonly PasswordHasher<AppUser> _Hasher = new PasswordHasher<AppUser>();
// private readonly int count;
// public UserConfiguration(int count)
// {
// this.count = count;
// }
// private List<AppUser> GenerateUsers()
// {
// var fakerUser = new Faker<AppUser>()
// .RuleFor(u => u.Name, f => f.Name.FullName(f.Person.Gender))
// .RuleFor(u => u.Email, (f, u) => f.Internet.Email(u.Name))
// .RuleFor(u => u.EmailConfirmed, true)
// .RuleFor(u => u.Building, f => f.Address.BuildingNumber())
// .RuleFor(u => u.Floor, f => f.Random.Number(1, 3))
// .RuleFor(u => u.Flat, f => f.Random.Number(3, 10))
// .RuleFor(u => u.PhotoPath, f => f.Person.Avatar)
// .RuleFor(u => u.PasswordHash, (f, u) => _Hasher.HashPassword(u, "aaa111!!!AAA"))
// .RuleFor(u => u.PhoneNumber, f => f.Phone.PhoneNumber())
// .RuleFor(u => u.locationLati, f => f.Random.Number(300))
// .RuleFor(u => u.locationLong, f => f.Random.Number(300));
// return fakerUser.Generate(count);
// }
// public void Configure(EntityTypeBuilder<AppUser> builder)
// {
// var adminUser = new AppUser()
// {
// Id = Guid.NewGuid().ToString(),
// Name = "said",
// Email = "said.amir.kattan@outlook.com",
// UserName = "said.amir.kattan@outlook.com",
// NormalizedEmail = "said.amir.kattan@outlook.com".ToUpper(),
// NormalizedUserName = "said.amir.kattan@outlook.com".ToUpper(),
// PhoneNumber = "01231231322",
// EmailConfirmed = true,
// PasswordHash = _Hasher.HashPassword(null, "aaa111!!!AAA")
// };
// builder.HasData(GenerateUsers(), adminUser);
// }
// }