private static IServiceCollection AddPersistedStoreRepository(
            this IServiceCollection services,
            Action <PersistedStoreOptions> storeOptionsAction = null)
        {
            var storeOptions = new PersistedStoreOptions();

            storeOptionsAction?.Invoke(storeOptions);
            services.AddSingleton(storeOptions);
            services.AddSingleton <PersistedGrantStoreCacheHandle>(
                new PersistedGrantStoreCacheHandle(storeOptions));
            services.AddSingleton <IPersistedGrantStoreRepository,
                                   PersistedGrantStoreRepository>();

            return(services);
        }
示例#2
0
 public PersistedGrantStoreCacheHandle(
     PersistedStoreOptions options)
 {
     this.options = options;
     cache        = Utilities.CreateCache(options);
 }