Пример #1
0
        // GET: Cars/Create
        public IActionResult Create()
        {
            var carSetViewModel = new CarSetViewModel
            {
                Producers = _context.Producers.ToList(),
                Car       = new Car(),
            };

            return(View(carSetViewModel));
        }
Пример #2
0
        // GET: Cars/Edit/5
        public IActionResult Edit(Guid id)
        {
            var car = _carService.Get(id);

            var vm = new CarSetViewModel
            {
                Car       = car,
                Id        = car.Id,
                Producers = _context.Producers.ToList(),
            };

            return(View(vm));
        }