public async Task <IActionResult> PutCommand(string id, Command command) { if (id != command.KeyCommand) { return(BadRequest()); } _context.Entry(command).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CommandExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutTweet(int id, Tweet tweet) { if (id != tweet.ID) { return(BadRequest()); } _context.Entry(tweet).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TweetExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }