public ActionResult UserRoles(string id) { ViewModels.Account.SelectableUserRoleViewModel viewModel; List<ViewModels.Account.SelectableUserRoleViewModel> rolesList; rolesList = new List<ViewModels.Account.SelectableUserRoleViewModel>(); Roles.GetAllRoles().ToList().ForEach(x => { bool a = Roles.IsUserInRole(id, x); viewModel = new ViewModels.Account.SelectableUserRoleViewModel() { Username = id, Rolename = x, IsSelected = Roles.IsUserInRole(id, x) }; rolesList.Add(viewModel); }); return View(rolesList); }
public ActionResult UserRoles(string id) { ViewModels.Account.SelectableUserRoleViewModel viewModel; List <ViewModels.Account.SelectableUserRoleViewModel> rolesList; rolesList = new List <ViewModels.Account.SelectableUserRoleViewModel>(); Roles.GetAllRoles().ToList().ForEach(x => { bool a = Roles.IsUserInRole(id, x); viewModel = new ViewModels.Account.SelectableUserRoleViewModel() { Username = id, Rolename = x, IsSelected = Roles.IsUserInRole(id, x) }; rolesList.Add(viewModel); }); return(View(rolesList)); }