private async Task <bool> CreateAdmin(JoinAdminModel model) { var byteKey = _cryptoProvider.GetTokenBytes(model.AccessToken); var token = await _serviceDb.AdminTokens.SingleOrDefaultAsync(x => x.TokenData.SequenceEqual(byteKey)); if (token == null || token.isUsed == true) { return(false); } token.isUsed = true; await _serviceDb.SaveChangesAsync(); return(await _joinService.JoinAdmin(model)); }