public async Task <ActionResult> Index() { var regions = await _placesService.GetAllRegions(); var res = mapper.Map <List <Region>, List <RegionViewModel> >(regions); IndexRegionViewModel indexViewModel = new IndexRegionViewModel(); foreach (var item in res) { item.Municipalities = await _placesService.GetNumberOfMunicipalitiesByRegion(item.Id); } indexViewModel.ListRegions = res; indexViewModel.Region = new RegionViewModel(); indexViewModel.IsError = false; indexViewModel.IsEditing = false; return(View(indexViewModel)); }