Exemple #1
0
        // GET: Engine
        public ActionResult Index()
        {
            List <Engine>          engines          = _uow.EngineRepository.GetAll();
            List <EngineViewModel> engineViewModels = EngineViewModel.ToList(engines);

            return(View(engineViewModels));
        }
        private void MakeEnginesViewBag(EngineViewModel engineViewModel = null)
        {
            List <Engine>          engine           = _uow.EngineRepository.GetAll();
            List <EngineViewModel> engineViewModels = EngineViewModel.ToList(engine);

            if (engineViewModel != null)
            {
                ViewBag.Engines = new SelectList(engineViewModels, "ID", "Info", engineViewModel.ID);
            }
            else
            {
                ViewBag.Engines = new SelectList(engineViewModels, "ID", "Info");
            }
        }