private void PopulateAssignedWAData(OccupationVM occupation) { var all = waService.GetAll(); var occupationWA = new HashSet <int>(occupation.WorkAvailabilities.Select(c => c.WorkAvailabilityId)); var viewModel = new List <SelectedItems>(); foreach (var item in all) { viewModel.Add(new SelectedItems { Id = item.Id, DescriptionEN = item.DescriptionEN, DescriptionPT = item.DescriptionPT, Assigned = occupationWA.Contains(item.Id) }); } ViewData["WorkAvailabilities"] = viewModel; }
public IActionResult Index() { return(View(waService.GetAll())); }