c# - Add User to ApplicationRole by RoleId -


i noticed when using usermanager class, addtorole method, can add users roles name, not role id. there way this? way system built, more 1 role may have same name. i'm looking like:

usermanager.addtorole(user.userid, role.roleid); 

where addtorole has arguments userid , roleid.

your role names should unique. if have role names same, how differentiate between them?

you use linq , name id roles.where(r => r.id == yourroleid).first().name ?


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -