public async Task <IActionResult> PuttblUserSessions([FromRoute] int id, [FromBody] tblUserSessions tblUserSessions) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tblUserSessions.UserID) { return(BadRequest()); } _context.Entry(tblUserSessions).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!tblUserSessionsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public virtual async Task CommitAsync() { await _context.SaveChangesAsync(); }