TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Krishnan Suba
1.7k
82
15k
How to assign the multiple roles in single user?
Aug 29 2019 9:57 AM
we using bulk user upload using excel, the field name is Username, Email, fname, lname, Role1, Role2 and Role3.
The username, email,fname, lname saving the data in db its working fine.
How to assign the 3 roles in single user.
I using below code
var newUser = new UserInfo{
UserName = userDto.UserName,
FirstName = userDto.FirstName,
LastName = userDto.LastName,
Email = userDto.Email,
SiteIndependentPrivilegeLevel = CMS.Base.UserPrivilegeLevelEnum.None };
var newUserSettings = newUser.UserSettings ?? new UserSettingsInfo();
UserInfoProvider.SetUserInfo(newUser);
UserInfoProvider.AddUserToSite(newUser.UserName, site.SiteName);
var role = new RoleProvider().GetAllRoles(site.SiteID)
.FirstOrDefault(r => r.Description == userDto.Role1);
// .(r => r.Description == userDto.Role1, userDto.Role2, userDto.Role3);
UserInfoProvider.AddUserToRole(newUser.UserID, role.ID);
return newUser;
Reply
Answers (
2
)
Timeout expired
How to DeserializeObject into my entity in below json string