public async Task <IActionResult> PutCoin(int id, Coin coin) { if (id != coin.CoinId) { return(BadRequest()); } _context.Entry(coin).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CoinExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutExchange(int id, Exchange exchange) { if (id != exchange.ExchangeId) { return(BadRequest()); } _context.Entry(exchange).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ExchangeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public void UpdateCoin(Coin coin) { context.Entry(coin).State = EntityState.Modified; }