RoleConfiguration.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using Microsoft.AspNetCore.Identity;
  2. using Microsoft.EntityFrameworkCore;
  3. using Microsoft.EntityFrameworkCore.Metadata.Builders;
  4. using MTWorkHR.Infrastructure.Entities;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace MTWorkHR.Infrastructure.Configurations
  11. {
  12. public class RoleConfiguration : IEntityTypeConfiguration<ApplicationRole>
  13. {
  14. public void Configure(EntityTypeBuilder<ApplicationRole> builder)
  15. {
  16. builder.HasData(
  17. new ApplicationRole
  18. {
  19. Id = "AD5B3B92-2311-48F8-9DEC-F9FAEF1F211A",
  20. Name = "Admin",
  21. NormalizedName = "ADMIN",
  22. IsAdmin = true,
  23. IsDeleted = false,
  24. },
  25. new ApplicationRole
  26. {
  27. Id = "EM5B3B92-2311-48F8-9DEC-F9FAEF1F211E",
  28. Name = "Employee",
  29. NormalizedName = "EMPLOYEE",
  30. IsAdmin = false,
  31. IsDeleted = false,
  32. }
  33. ,
  34. new ApplicationRole
  35. {
  36. Id = "CO5B3B92-2311-48F8-9DEC-F9FAEF1F211R",
  37. Name = "Contractor",
  38. NormalizedName = "CONTRACTOR",
  39. IsAdmin = false,
  40. IsDeleted = false,
  41. }
  42. );
  43. }
  44. }
  45. }