public async Task <IActionResult> Edit(long id, [Bind("Id,Amount,OpenDate")] TaxAccount taxAccount) { if (id != taxAccount.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(taxAccount); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TaxAccountExists(taxAccount.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(taxAccount)); }
public async Task <IActionResult> Create([Bind("Id,Amount,OpenDate")] TaxAccount taxAccount) { if (ModelState.IsValid) { _context.Add(taxAccount); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(taxAccount)); }