Exemple #1
0
        private ICompressedStorage GetStorageOnce(IDictionary <string, object> environment)
        {
            ICompressedStorage storage = _options.CompressedStorageProvider.Create();
            var onAppDisposing         = new OwinRequest(environment).Get <CancellationToken>("host.OnAppDisposing");

            if (onAppDisposing != CancellationToken.None)
            {
                onAppDisposing.Register(storage.Dispose);
            }
            return(storage);
        }
 private ICompressedStorage GetStorageOnce(IDictionary<string, object> environment)
 {
     ICompressedStorage storage = _options.CompressedStorageProvider.Create();
     var onAppDisposing = new OwinRequest(environment).Get<CancellationToken>("host.OnAppDisposing");
     if (onAppDisposing != CancellationToken.None)
     {
         onAppDisposing.Register(storage.Dispose);
     }
     return storage;
 }