标签:
using Microsoft.AspNet.Identity;
public ActionResult AddRole(String name)
{
using (var roleManager = new RoleManager<IdentityRole>(
new RoleStore<IdentityRole>(new IdentityDbContext())))
{
if (!roleManager.RoleExists(name))
{
roleManager.Create(new IdentityRole(name));
}
}
}
标签:
原文地址:http://www.cnblogs.com/pauldng/p/5241987.html