public async Task <IActionResult> PutTweetItem(long id, TweetItem tweetItem) { if (id != tweetItem.Id) { return(BadRequest()); } _context.Entry(tweetItem).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TweetItemExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public void Update(TEntity entity) { _context.Entry(entity).State = EntityState.Modified; Save(); }