Пример #1
0
        public void Persist(string key, Stream stream)
        {
            var basePath = _fileSystemWrapper.MapPath(_cachePath);

            _fileSystemWrapper.EnsureDirectory(basePath);

            var path = ResolveStoragePath(key);

            _fileSystemWrapper.Create(path, stream);

            if (stream.CanSeek)
            {
                stream.Seek(0, SeekOrigin.Begin);
            }
        }