예제 #1
0
        public IActionResult Create()
        {
            var repairCars   = _repairCarRepository.GetAll();
            var vmRepairCars = new CarViewModel();

            foreach (var repairCar in repairCars)
            {
                vmRepairCars.ListRepairCar.Add(
                    new SelectListItem
                {
                    Text  = repairCar.Description,
                    Value = repairCar.RepairCost.ToString()
                });
            }

            return(View(vmRepairCars));
        }
예제 #2
0
        public IActionResult Index()
        {
            var repairs = _repairCarRepository.GetAll();

            return(View(repairs));
        }