public ActionResult ActionUserRoleMapping() { Models.AdminViewModel adminViewModel = new Models.AdminViewModel(); adminViewModel.ActionList = _uiddlRepo.getActionLinkDropDown(); adminViewModel.EntitlementList = _uiddlRepo.getEntitleMentDropDown(); EntitlementActionDTO data = new EntitlementActionDTO(); data.ActionDetails = new ActionDTO(); data.RoleDetails = new EntitlementDTO(); StatusDTO <List <EntitlementActionDTO> > status = _entitlementActionSvc.Select(data); if (status.ReturnObj != null && status.ReturnObj.Count > 0) { adminViewModel.entitlementactionList = new List <AdminViewModel>(); // instantiating list of AdminViewmodel if (status.IsSuccess && !status.IsException) { AdminViewModel adviewmodel; foreach (EntitlementActionDTO entitlement in status.ReturnObj) { if (entitlement != null) { adviewmodel = new AdminViewModel(); // instantiating each student adviewmodel.RowId = entitlement.RowId; adviewmodel.ActionDetails = entitlement.ActionDetails; adviewmodel.RoleDetails = entitlement.RoleDetails; //Add into Student vIew Model List adminViewModel.entitlementactionList.Add(adviewmodel); adminViewModel.IsSearchSuccessful = true; } } } } return(View(adminViewModel)); }