public async Task <IActionResult> Edit(int id, [Bind("Name,UtcOffset,Dst,Id,Modified")] MTimeZone mTimeZone) { if (id != mTimeZone.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mTimeZone); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MTimeZoneExists(mTimeZone.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(mTimeZone)); }
public async Task <IActionResult> Create([Bind("Name,UtcOffset,Dst,Id,Modified")] MTimeZone mTimeZone) { if (ModelState.IsValid) { _context.Add(mTimeZone); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(mTimeZone)); }