private void SeedRoles(BaseProjectDbContext context) { var roles = new[] { new Role { Id = RolesNames.Admin.Id, Name = RolesNames.Admin.Name, NormalizedName = RolesNames.Admin.Name.ToUpper() }, new Role { Id = RolesNames.SuperAdmin.Id, Name = RolesNames.SuperAdmin.Name, NormalizedName = RolesNames.SuperAdmin.Name.ToUpper() } }; context.Roles.AddRange(roles); context.SaveChanges(); }
private void SeedUsers(BaseProjectDbContext context) { var userSuperAdmin = new User() { FirstName = "Admin", LastName = "Devlights", Email = "*****@*****.**", UserName = "******", NormalizedEmail = "*****@*****.**".ToUpper(), NormalizedUserName = "******".ToUpper(), CreationTime = DateTime.Now, ConcurrencyStamp = "a07301d1-bc56-4e99-a2b3-b59e438bb129", SecurityStamp = "6YYH5RHYUXZC7RVJ4CHFGYRST465ZVFY", PasswordHash = "AQAAAAEAACcQAAAAECqWq4BVHlxZP8v3+lJHuZEt4rHoP8zQ6peVBNjjQvUDuPHUiC8GkrpuVNEw5O8Q7w==" }; context.Users.Add(userSuperAdmin); var userRole = new UserRole() { RoleId = RolesNames.SuperAdmin.Id, UserId = userSuperAdmin.Id }; context.UserRoles.Add(userRole); //context.Users.AddRange(users); context.SaveChanges(); }