RoleConfiguration.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. new ApplicationRole
  44. {
  45. Id = "BS5B3B92-2311-48F8-9DEC-F9FAEF1F2110",
  46. Name = "Business",
  47. NormalizedName = "BUSINESS",
  48. IsAdmin = false,
  49. IsDeleted = false,
  50. }
  51. );
  52. }
  53. }
  54. }