Beispiel #1
0
        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());
        }
Beispiel #2
0
        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());
        }
Beispiel #3
0
 public void UpdateCoin(Coin coin)
 {
     context.Entry(coin).State = EntityState.Modified;
 }