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));
        }
示例#2
0
        public ActionResult Index()
        {
            var climates = climateRepository.GetClimates();

            var viewModels = new List <ClimateViewModel>();

            climates.ForEach(c => viewModels.Add(new ClimateViewModel(c)));

            return(View(viewModels));
        }