Exemplo n.º 1
0
        // GET: Routs/Edit/5
        public async Task <IActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var rout = _dbAccess.FindRout(id.Value);

            if (rout == null)
            {
                return(NotFound());
            }
            var cities = _dbAccess.GetCities();

            ViewData["EndCityId"]   = new SelectList(cities, "Name", "Id", rout.EndCityId);
            ViewData["StartCityId"] = new SelectList(cities, "Name", "Id", rout.StartCityId);
            return(View(rout));
        }