Example #1
0
        private void CreateRoles()
        {
            DSDbContext db = new DSDbContext();

            var roleManager = new RoleManager <IdentityRole>(new RoleStore <IdentityRole>(db));

            if (!roleManager.RoleExists("Admin"))
            {
                var role = new IdentityRole();
                role.Name = "Admin";
                roleManager.Create(role);
            }

            if (!roleManager.RoleExists("User"))
            {
                var role = new IdentityRole();
                role.Name = "User";
                roleManager.Create(role);
            }
        }
Example #2
0
 public DSUserStore(DSDbContext context) : base(context)
 {
 }
Example #3
0
 public ValuesController(DSDbContext context)
 {
     this.context = context;
 }