Ejemplo n.º 1
0
        private Task <Stream> ReadStreamAsync(IPersistentStorage storage, string key, object documentOrProject, CancellationToken cancellationToken)
        {
            if (documentOrProject is Document document)
            {
                return(storage.ReadStreamAsync(document, key, cancellationToken));
            }

            var project = (Project)documentOrProject;

            return(storage.ReadStreamAsync(project, key, cancellationToken));
        }
                protected override Task <Stream> ReadStreamAsync(IPersistentStorage storage, object value, CancellationToken cancellationToken)
                {
                    var document = value as Document;

                    if (document != null)
                    {
                        return(storage.ReadStreamAsync(document, _stateName, cancellationToken));
                    }

                    var project = (Project)value;

                    return(storage.ReadStreamAsync(project, _stateName, cancellationToken));
                }
Ejemplo n.º 3
0
 protected override Task <Stream> ReadStreamAsync(IPersistentStorage storage, Document value, CancellationToken cancellationToken)
 => storage.ReadStreamAsync(value, StateName, cancellationToken);
Ejemplo n.º 4
0
        private Task<Stream> ReadStreamAsync(IPersistentStorage storage, string key, object documentOrProject, CancellationToken cancellationToken)
        {
            var document = documentOrProject as Document;
            if (document != null)
            {
                return storage.ReadStreamAsync(document, key, cancellationToken);
            }

            var project = (Project)documentOrProject;
            return storage.ReadStreamAsync(project, key, cancellationToken);
        }