public async Task <IActionResult> PutNewsModel(int id, NewsModel newsModel) { if (id != newsModel.Id) { return(BadRequest()); } _context.Entry(newsModel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!NewsModelExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <UserModel> PutUserModel(int id, UserModel userModel) { if (id != userModel.Id) { } _context.Entry(userModel).State = EntityState.Modified; await _context.SaveChangesAsync(); return(userModel); }