public async Task <IActionResult> PutAuthMethod(int id, AuthMethod authMethod) { if (id != authMethod.AuthMethodId) { return(BadRequest()); } _context.Entry(authMethod).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AuthMethodExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async static Task <int> GetNextIdAsync(SSAuthContext dbContext, string table_name) { var tableNextIDObject = await dbContext.SeqControl.Where(x => x.ObjName == table_name).FirstOrDefaultAsync(); tableNextIDObject.NextId += 1; dbContext.Entry(tableNextIDObject).Property(x => x.NextId).IsModified = true; await dbContext.SaveChangesAsync(); return(tableNextIDObject.NextId); }