public async Task <IActionResult> Edit(int id, [Bind("Id,Name,City,Lat,Long")] Theator theator) { if (id != theator.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(theator); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TheatorExists(theator.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(theator)); }
public async Task <IActionResult> Create([Bind("Id,Name,City,Lat,Long")] Theator theator) { if (ModelState.IsValid) { _context.Add(theator); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(theator)); }