Exemple #1
0
        private Stream ReadStream(int projectId, int nameId, object unused1, object unused2, object unused3, CancellationToken cancellationToken)
        {
            using (var accessor = _esentStorage.GetProjectTableAccessor())
                using (var esentStream = accessor.GetReadStream(projectId, nameId))
                {
                    if (esentStream == null)
                    {
                        return(null);
                    }

                    // this will copy over esent stream and let it go.
                    return(SerializableBytes.CreateReadableStream(esentStream, cancellationToken));
                }
        }
 private EsentStorage.ProjectDocumentTableAccessor GetAccessor(EsentStorage.Key key)
 {
     return(key.DocumentIdOpt.HasValue ?
            _esentStorage.GetDocumentTableAccessor() :
            (EsentStorage.ProjectDocumentTableAccessor)_esentStorage.GetProjectTableAccessor());
 }