Files
gwms/GWMS.Data/RoleConfiguration.cs
T

44 lines
1.2 KiB
C#

using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GWMS.Data
{
public class RoleConfiguration : IEntityTypeConfiguration<IdentityRole>
{
#region Public Methods
public void Configure(EntityTypeBuilder<IdentityRole> builder)
{
builder.HasData(
new IdentityRole
{
Name = "ExtUser",
NormalizedName = "EXTUSER"
},
new IdentityRole
{
Name = "User",
NormalizedName = "USER"
},
new IdentityRole
{
Name = "Admin",
NormalizedName = "ADMINISTRATOR"
},
new IdentityRole
{
Name = "SuperAdmin",
NormalizedName = "SUPERADMINISTRATOR"
}
);
}
#endregion Public Methods
}
}