public async Task <IActionResult> Edit(int id, [Bind("RouteId,StartPoint,EndPoint,RouteLength")] Broute broute) { if (id != broute.RouteId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(broute); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BrouteExists(broute.RouteId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(broute)); }
public async Task <IActionResult> Create([Bind("RouteId,StartPoint,EndPoint,RouteLength")] Broute broute) { if (ModelState.IsValid) { _context.Add(broute); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(broute)); }