Files
webdoorcreator/WebDoorCreator.Data/RoleConfiguration.cs
2023-03-07 09:09:42 +01:00

31 lines
1.0 KiB
C#

using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WebDoorCreator.Data
{
public class RoleConfiguration : IEntityTypeConfiguration<IdentityRole>
{
#region Public Methods
public void Configure(EntityTypeBuilder<IdentityRole> builder)
{
builder.HasData(
new IdentityRole { Name = "Undef", NormalizedName = "UNDEF" },
new IdentityRole { Name = "SuperAdmin", NormalizedName = "SUPERADMIN" },
new IdentityRole { Name = "Admin", NormalizedName = "ADMIN" },
new IdentityRole { Name = "CompAdmin", NormalizedName = "COMPADMIN" },
new IdentityRole { Name = "CompUser", NormalizedName = "COMPUSER" },
new IdentityRole { Name = "User", NormalizedName = "USER" }
);
}
#endregion Public Methods
}
}