private void InitListViewModel(RoleItemsViewModel viewModel, RoleItems list) { foreach (var item in viewModel.Items) { InitBaseItemViewModel(item); } }
public ActionResult List(RoleFilterViewModel filterViewModel) { InitRoleFilterViewModel(ref filterViewModel, true); var filter = Mapper.Map <RoleFilter>(filterViewModel); RoleItems list = _roleRepository.GetRoleItems(UserContext.User.Id, UserContext.User.OrganizationId, filter); RoleItemsViewModel viewModel = Mapper.Map <RoleItemsViewModel>(list); viewModel.Filter = filterViewModel; InitListViewModel(viewModel, list); return(View(Mvc.View.Role.List, viewModel)); }