How would I mimic User.IsInRole()

后端 未结 4 1588
被撕碎了的回忆
被撕碎了的回忆 2020-12-30 13:38

I have a website thats build with VS 2012 Internet Application ( Simple membership) EF Code First

Updates

I would like

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-30 14:41

    try this way

    List AllClinets =entityObject.Clinets .ToList();
    
    Foreach( var check in AllClinets)
    {
      if(check.UserTable.RoleTable.RoleName=="Rolename1")
       {
          //This users are Rolename1 
       }
      else
       {
       //other.
       }
    }
    

提交回复
热议问题