Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

Store does not implement IQueryableRoleStore in ASP.Net Identity

$
0
0

Hello,

I am tying to bind a dropdownlist with all roles in asp.net web forms app (VS 2013)...with following bind method...

public IQueryable<IdentityRole> BindRoles()
    {
        var roles = roleManager.Roles;
        return roles;
    }

How do I initialize...

    public ApplicationDbContext context;
    private UserManager<ApplicationUser> userManager;
    public RoleManager<IdentityRole> roleManager;

    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        context = new ApplicationDbContext();
        userManager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(context));
        roleManager = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(context));
    }

Dropdownlist Binding: SelectMethod="BindRoles"

But when I run the page it has following error..

Store does not implement IQueryableRoleStore

Help..


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>