UserConfiguration.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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.Infrastructure.Entities;
  10. namespace MTWorkHR.Infrastructure.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 = "Super",
  22. LastName = "Admin",
  23. UserName = "Admin@super.com",
  24. Email = "admin@super.com",
  25. NormalizedEmail = "ADMIN@SUPER.COM",
  26. EmailConfirmed = true,
  27. NormalizedUserName = "ADMIN@SUPER.COM",
  28. PhoneNumber = "1234567890",
  29. PhoneNumberConfirmed = true,
  30. IsDeleted = false,
  31. IsStopped = false,
  32. DeleteUserId = null,
  33. AccessFailedCount = 0,
  34. UserType = 0,
  35. ConcurrencyStamp = "7cc87689-9eab-4280-b8e3-1834080783a5",
  36. SecurityStamp = "49bb16c3-4704-4c60-908d-dc8506950acc",
  37. PassportNumber = "123456700",
  38. TaxNumber = 111334455,
  39. IncomeTaxValue = 1,
  40. QualificationId = null,
  41. IdNumber = "1234",
  42. DateOfBirth = new DateTime(2000, 2, 10),
  43. CompanyId = null,
  44. PasswordHash = "AQAAAAIAAYagAAAAEPg+ASbciPFxtyxQq8Wx5ilBUQ0RbAoITXXkOQm1PzC5BzySX0sn/wUmOjBKPDGV9w==" //hasher.HashPassword(null, "P@ssword1")
  45. },
  46. new ApplicationUser
  47. {
  48. Id = "AL5B3B92-2311-48F8-9DEC-F9FAEF1F21UB",
  49. FirstName = "Ali",
  50. LastName = "Farok",
  51. UserName = "Ali@b.com",
  52. Email = "ali@b.com",
  53. NormalizedEmail = "ALI@B.COM",
  54. EmailConfirmed = true,
  55. NormalizedUserName = "ALI@B.COM",
  56. PhoneNumber = "1234567888",
  57. PhoneNumberConfirmed = true,
  58. DeleteUserId = null,
  59. AccessFailedCount = 0,
  60. IsDeleted = false,
  61. IsStopped = false,
  62. UserType = 1,
  63. ConcurrencyStamp = "4af7b4cf-802a-455b-b598-997e167745b3",
  64. SecurityStamp = "62549056-1b9d-46d4-84f8-adea3e4d8b68",
  65. PassportNumber = "7654321001010",
  66. TaxNumber = 222,
  67. IncomeTaxValue = 100,
  68. QualificationId = null,
  69. IdNumber = "343434",
  70. DateOfBirth = new DateTime(2001, 5, 13),
  71. CompanyId = 1,
  72. PasswordHash = "AQAAAAIAAYagAAAAEI3QJkcZjCH4Y8Db4rEgL8Mmll5oCvYcWiXZjQSN9bGW4SMcjHe3ZPMnkN/l9DmJeQ=="// hasher.HashPassword(null, "P@ssword1")
  73. }) ;
  74. }
  75. }
  76. }