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)); }
protected override Task <Stream> ReadStreamAsync(IPersistentStorage storage, Document value, CancellationToken cancellationToken) => storage.ReadStreamAsync(value, StateName, cancellationToken);
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); }