public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Establishment,Address,DateTime,Thoughts")] NorthLocations northLocations) { if (id != northLocations.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(northLocations); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!NorthLocationsExists(northLocations.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(northLocations)); }
public async Task <IActionResult> Create([Bind("Id,Name,Establishment,Address,DateTime,Thoughts")] NorthLocations northLocations) { if (ModelState.IsValid) { _context.Add(northLocations); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(northLocations)); }