Get all role names in ASP.NET MVC5 Identity system

前端 未结 3 1058
时光取名叫无心
时光取名叫无心 2020-12-25 14:31

MVC5 uses a new Identity System. How can I get all role names?

I try do access it via IdentityStore but without success.

3条回答
  •  醉梦人生
    2020-12-25 14:38

    This is a bit more intuitive

    var roles = dbContext.Roles.OrderBy(x => x.Name);
    

提交回复
热议问题