Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 156 additions & 0 deletions EventsExpress.Db/DbInitialize/DbInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,162 @@ public static void Seed(AppDbContext dbContext, IPasswordHasher passwordHasher)
};

dbContext.Users.AddRange(users);
dbContext.Users.Add(new User
{
Name = "BAUser1",
Email = "bauser1@gmail.com",
Phone = "+380974293581",
Birthday = DateTime.Parse("2000-01-02"),
Gender = Gender.Other,
Account = new Account
{
IsBlocked = false,
AuthLocal = new AuthLocal
{
PasswordHash = passwordHasher.GenerateHash("1qaz1qaz1", saltDef),
Salt = saltDef,
Email = "bauser1@gmail.com",
EmailConfirmed = true,
},
AccountRoles = new[]
{
new AccountRole
{
RoleId = Enums.Role.User,
},
},
},
});
dbContext.Users.Add(new User
{
Name = "BAUser2",
Email = "bauser2@gmail.com",
Phone = "+380974293582",
Birthday = DateTime.Parse("2000-01-03"),
Gender = Gender.Female,
Account = new Account
{
IsBlocked = false,
AuthLocal = new AuthLocal
{
PasswordHash = passwordHasher.GenerateHash("1qaz1qaz2", saltDef),
Salt = saltDef,
Email = "bauser2@gmail.com",
EmailConfirmed = true,
},
AccountRoles = new[]
{
new AccountRole
{
RoleId = Enums.Role.User,
},
},
},
});
dbContext.Users.Add(new User
{
Name = "QCUser1",
Email = "qcuser1@gmail.com",
Phone = "+380974293583",
Birthday = DateTime.Parse("2000-01-04"),
Gender = Gender.Male,
Account = new Account
{
IsBlocked = false,
AuthLocal = new AuthLocal
{
PasswordHash = passwordHasher.GenerateHash("1qaz1qaz3", saltDef),
Salt = saltDef,
Email = "qcuser1@gmail.com",
EmailConfirmed = true,
},
AccountRoles = new[]
{
new AccountRole
{
RoleId = Enums.Role.User,
},
},
},
});
dbContext.Users.Add(new User
{
Name = "QCUser2",
Email = "qcuser2@gmail.com",
Phone = "+380974293584",
Birthday = DateTime.Parse("2000-01-05"),
Gender = Gender.Other,
Account = new Account
{
IsBlocked = false,
AuthLocal = new AuthLocal
{
PasswordHash = passwordHasher.GenerateHash("1qaz1qaz4", saltDef),
Salt = saltDef,
Email = "qcuser2@gmail.com",
EmailConfirmed = true,
},
AccountRoles = new[]
{
new AccountRole
{
RoleId = Enums.Role.User,
},
},
},
});
dbContext.Users.Add(new User
{
Name = "QCUser3",
Email = "qcuser3@gmail.com",
Phone = "+380974293585",
Birthday = DateTime.Parse("2000-01-06"),
Gender = Gender.Female,
Account = new Account
{
IsBlocked = false,
AuthLocal = new AuthLocal
{
PasswordHash = passwordHasher.GenerateHash("1qaz1qaz5", saltDef),
Salt = saltDef,
Email = "qcuser3@gmail.com",
EmailConfirmed = true,
},
AccountRoles = new[]
{
new AccountRole
{
RoleId = Enums.Role.User,
},
},
},
});
dbContext.Users.Add(new User
{
Name = "QCUser4",
Email = "qcuser4@gmail.com",
Phone = "+380974293586",
Birthday = DateTime.Parse("2000-01-07"),
Gender = Gender.Male,
Account = new Account
{
IsBlocked = false,
AuthLocal = new AuthLocal
{
PasswordHash = passwordHasher.GenerateHash("1qaz1qaz6", saltDef),
Salt = saltDef,
Email = "qcuser4@gmail.com",
EmailConfirmed = true,
},
AccountRoles = new[]
{
new AccountRole
{
RoleId = Enums.Role.User,
},
},
},
});

var categories = new Category[]
{
Expand Down