public async Task <IActionResult> Create([Bind("Id,AccountNo,WithdrawalDate")] AccountA accountA) { if (ModelState.IsValid) { _context.Add(accountA); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(accountA)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,AccountNo,WithdrawalDate")] AccountB accountB) { if (id != accountB.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _contextA.Update(accountB); await _contextA.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AccountAExists(accountB.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(QueryResults))); } return(View(accountB)); }