コード例 #1
0
        private static IEnumerable <IdentityRole> GetDefaultRoles()
        {
            var roleNames = IdentityConfig.GetRoleNames();
            var roles     = roleNames.Select(x => new IdentityRole
            {
                Id = Guid.NewGuid().ToString("D"),
                ConcurrencyStamp = Guid.NewGuid().ToString("D"),
                Name             = x,
                NormalizedName   = x.ToUpperInvariant()
            });

            return(roles);
        }