public Task StoreAsync(PersistedGrant token)
        {
            var existing = _persistedgrantprovider.Get(token.Key);

            try
            {
                if (existing == null)
                {
                    _logger.LogDebug("{persistedGrantKey} not found in database", token.Key);

                    _persistedgrantprovider.Add(token);
                }
                else
                {
                    _logger.LogDebug("{persistedGrantKey} found in database", token.Key);

                    _persistedgrantprovider.Update(token);
                }
            }
            catch (Exception ex)
            {
                _logger.LogWarning("exception updating {persistedGrantKey} persisted grant in database: {error}", token.Key, ex.Message);
            }

            return(Task.FromResult(0));
        }
        public async Task StoreAsync(PersistedGrant token)
        {
            var existing = await _persistedgrantprovider.Get(token.Key);

            if (existing == null)
            {
                await _persistedgrantprovider.Add(token);
            }
            else
            {
                await _persistedgrantprovider.Update(token);
            }
        }