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

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Website Login Issue developed in magento -

Can the constants be defined inside a model file of a framework in PHP? -