public async Task <IActionResult> Edit(int id, [Bind("LocationTimeZoneId,Name,TimeZoneValue")] LocationTimeZone locationTimeZone) { if (id != locationTimeZone.LocationTimeZoneId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(locationTimeZone); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LocationTimeZoneExists(locationTimeZone.LocationTimeZoneId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(locationTimeZone)); }
public async Task <IActionResult> Create([Bind("LocationTimeZoneId,Name,TimeZoneValue")] LocationTimeZone locationTimeZone) { if (ModelState.IsValid) { _context.Add(locationTimeZone); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(locationTimeZone)); }