Beispiel #1
0
 public DistributedDataXmlRepository(IDistributedCache cache, DistributedDataXmlRepositoryOptions options)
 {
     this.cache   = cache;
     this.options = options;
 }
Beispiel #2
0
        public static IDataProtectionBuilder PersistKeysToDistributedCache(this IDataProtectionBuilder builder, DistributedDataXmlRepositoryOptions options = null)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            builder.Services.TryAddSingleton <IXmlRepository>(services => new DistributedDataXmlRepository(services.GetRequiredService <IDistributedCache>(),
                                                                                                           options ?? new DistributedDataXmlRepositoryOptions()));
            return(builder);
        }