예제 #1
0
        private UserDto PopulateRolesForUser(UserDto model, int applicationId, int userId)
        {
            var searchUserApplicationRoles = new UserApplicationRoleSearchModel {
                PageSize = int.MaxValue, SortColumn = "Role/Role/RoleName", SortDirection = "Asc", ApplicationId = applicationId, UserId = userId
            };

            searchUserApplicationRoles = _employeeApiClient.GetUserApplicationRoles(searchUserApplicationRoles).Result;
            var searchRoles = new RoleSearchModel {
                PageSize = int.MaxValue, SortColumn = "RoleName", SortDirection = "Asc", ApplicationId = applicationId
            };

            searchRoles          = _employeeApiClient.GetRoles(searchRoles).Result;
            model.RoleSelectList = SelectedListHelper.GetApplicationRolesSelectList(searchRoles.RoleSearchResult, searchUserApplicationRoles.UserApplicationRoleSearchResult.Select(x => x.Role.Id).ToList());
            return(model);
        }