示例#1
0
        public async Task <ActionResult> Index()
        {
            var municipalities = await _placesService.GetAllMunicipalities();

            var res = mapper.Map <List <Municipality>, List <MunicipalityViewModel> >(municipalities);
            IndexMunicipalityViewModel indexViewModel = new IndexMunicipalityViewModel();

            indexViewModel.ListMunicipalities = res;
            indexViewModel.Municipality       = new MunicipalityViewModel();
            indexViewModel.IsError            = false;
            indexViewModel.IsEditing          = false;
            return(View(indexViewModel));
        }