UserConfiguration.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using Microsoft.AspNetCore.Identity;
  2. using Microsoft.EntityFrameworkCore.Metadata.Builders;
  3. using Microsoft.EntityFrameworkCore;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using MTWorkHR.Identity.Models;
  10. namespace MTWorkHR.Identity.Configurations
  11. {
  12. public class UserConfiguration : IEntityTypeConfiguration<ApplicationUser>
  13. {
  14. public void Configure(EntityTypeBuilder<ApplicationUser> builder)
  15. {
  16. var hasher = new PasswordHasher<ApplicationUser>();
  17. builder.HasData(
  18. new ApplicationUser
  19. {
  20. Id = "ADMB3B92-2311-48F8-9DEC-F9FAEF1F21UA",
  21. FirstName = "Zinab",
  22. LastName ="Elgendy",
  23. UserName = "Admin",
  24. Email = "a@b.com",
  25. NormalizedEmail = "A@B.COM",
  26. EmailConfirmed = true,
  27. NormalizedUserName = "ADMIN",
  28. PhoneNumber = "1234567890",
  29. PhoneNumberConfirmed = true,
  30. IsDeleted = false,
  31. IsStopped = false,
  32. DeleteUserId = null,AccessFailedCount = 0,UserType = 1,
  33. ConcurrencyStamp= "7cc87689-9eab-4280-b8e3-1834080783a5",
  34. SecurityStamp = "49bb16c3-4704-4c60-908d-dc8506950acc",
  35. PasswordHash = "AQAAAAIAAYagAAAAEPg+ASbciPFxtyxQq8Wx5ilBUQ0RbAoITXXkOQm1PzC5BzySX0sn/wUmOjBKPDGV9w==" //hasher.HashPassword(null, "P@ssword1")
  36. },
  37. new ApplicationUser
  38. {
  39. Id = "AL5B3B92-2311-48F8-9DEC-F9FAEF1F21UB",
  40. FirstName = "Ali",
  41. LastName = "Farok",
  42. UserName = "ali",
  43. Email = "ali@b.com",
  44. NormalizedEmail = "ALI@B.COM",
  45. EmailConfirmed = true,
  46. NormalizedUserName = "ALI",
  47. PhoneNumber = "1234567890",
  48. PhoneNumberConfirmed = true,
  49. DeleteUserId = null,
  50. AccessFailedCount = 0,
  51. IsDeleted = false,
  52. IsStopped = false,
  53. UserType = 1,
  54. ConcurrencyStamp = "4af7b4cf-802a-455b-b598-997e167745b3",
  55. SecurityStamp = "62549056-1b9d-46d4-84f8-adea3e4d8b68",
  56. PasswordHash = "AQAAAAIAAYagAAAAEI3QJkcZjCH4Y8Db4rEgL8Mmll5oCvYcWiXZjQSN9bGW4SMcjHe3ZPMnkN/l9DmJeQ=="// hasher.HashPassword(null, "P@ssword1")
  57. }) ;
  58. }
  59. }
  60. }