private IEnumerable <LightPlanetViewModel> InitializePlanets()
        {
            var planets = planetRepository.GetPlanetsRaw();

            var viewmodels = new List <LightPlanetViewModel>();

            planets.ForEach(p => viewmodels.Add(LightPlanetViewModel.CreateFromModel(p)));

            return(viewmodels);
        }
Пример #2
0
        private ContainerFlightPathFormViewModel InitializeNewContainerFormViewModel(FlightPathFormViewModel viewModel = null)
        {
            var allPlanets = planetRepository.GetPlanetsRaw();

            var availableDepartures = new List <LightPlanetViewModel>();

            allPlanets.ForEach(p => availableDepartures.Add(LightPlanetViewModel.CreateFromModel(p)));

            var flightPathFormViewModel = viewModel ?? new FlightPathFormViewModel();

            return(new ViewModels.FlightPathViewModels.ContainerFlightPathFormViewModel(flightPathFormViewModel, availableDepartures));
        }