Пример #1
0
        public ActionResult Create()
        {
            Car           car       = new Car();
            CarsViewModel viewModel = CarsViewModel.FromCar(car);

            viewModel.Locations = viewModel.GetLocations();
            return(View(viewModel));
        }
Пример #2
0
        public ActionResult Edit(int Id)
        {
            Car           car       = context.Find(Id);
            CarsViewModel viewModel = CarsViewModel.FromCar(car);

            viewModel.Locations = viewModel.GetLocations();

            if (car == null)
            {
                return(HttpNotFound());
            }
            else
            {
                return(View(viewModel));
            }
        }