private void AfterAccessNotification(TokenCacheNotificationArgs args)
        {
            TokenCacheEntity tokenCacheEntity = new TokenCacheEntity(PartitionKey, _userId);

            tokenCacheEntity.SetData(Serialize());
            TableOperation     tokenCacheTableOperation = TableOperation.InsertOrReplace(tokenCacheEntity);
            Task <TableResult> tableOperationTask       = _tokenCacheTable.ExecuteAsync(tokenCacheTableOperation);

            if (!tableOperationTask.IsCompleted)
            {
                tableOperationTask.Wait();
            }
        }
        private void BeforeAccessNotification(TokenCacheNotificationArgs args)
        {
            TableOperation     tokenCacheTableOperation = TableOperation.Retrieve <TokenCacheEntity>(PartitionKey, _userId);
            Task <TableResult> tableOperationTask       = _tokenCacheTable.ExecuteAsync(tokenCacheTableOperation);

            if (!tableOperationTask.IsCompleted)
            {
                tableOperationTask.Wait();
            }
            TableResult tokenRecords = tableOperationTask.Result;

            if (tokenRecords.Result == null)
            {
                throw new ArgumentOutOfRangeException(nameof(_userId),
                                                      string.Concat("No data found for User ID: ", _userId));
            }
            TokenCacheEntity tokenCacheEntity = (TokenCacheEntity)tokenRecords.Result;

            Deserialize(tokenCacheEntity.GetData());
            _tokenCacheEntity = tokenCacheEntity;
        }