public async Task <ActionResult <AccountItem> > PostAccountItem(AccountItem accountItem) { _context.AccountItems.Add(accountItem); await _context.SaveChangesAsync(); return(CreatedAtAction("GetAccountItem", new { id = accountItem.Id }, accountItem)); }
public async Task <IActionResult> PutAccountItem(long id, AccountItem accountItem) { if (id != accountItem.Id) { return(BadRequest()); } _context.Entry(accountItem).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AccountItemExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }