public async Task <IActionResult> Edit(int id, [Bind("ID,Balance,Name,UnitSize,ExpectedPriceChange,RiskFreeInterestRate")] TradingAccount tradingAccount) { if (id != tradingAccount.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tradingAccount); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TradingAccountExists(tradingAccount.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(tradingAccount)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Ask,Bid,Contents,Delta,Quantity,Strike")] Option option) { if (id != option.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(option); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OptionExists(option.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(option)); }