public ActionResult New() { var climates = climateRepository.GetClimates(); var terrains = terrainRepository.GetTerrains(); var climateViewModels = PopulateClimates(climates, null); var terrainViewModels = PopulateTerrains(terrains, null); var viewModel = ContainerPlanetFormViewModel.CreateEmpty(climateViewModels, terrainViewModels); return(View("PlanetForm", viewModel)); }
public ActionResult Index() { var climates = climateRepository.GetClimates(); var viewModels = new List <ClimateViewModel>(); climates.ForEach(c => viewModels.Add(new ClimateViewModel(c))); return(View(viewModels)); }