Skip to content

Store does not implement IQueryableRoleStore<TRole> #38

@ranaanees

Description

@ranaanees

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..

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions