コード例 #1
0
        /// <summary>
        /// Retrieves the secret from the cache, if not present calls the underlying <see cref="ISecretRepository"/> to acquire and caches the result.
        /// </summary>
        /// <param name="clientId"></param>
        /// <returns></returns>
        public string ClientSecret(string clientId)
        {
            var key = CacheRegion.CacheKey(clientId);

            return(cachePolicy.Cache(key, () => Task.FromResult(repository.ClientSecret(clientId))).GetAwaiter().GetResult());
        }