• Basics
  • Abyss
  • Web APIs
  • C# & Razor
  • .net API
  • JS & TS API

    Show / Hide Table of Contents

    Class StreamFallback

    A DataSource that returns the first stream which has content

    The StreamFallback DataSource is part of the Standard EAV Data Sources. It will pass on the first stream which has results. The order of evaluation is based on the names of the streams as they enter the StreamFallback.

    How to use with the VisualQuery

    When using the VisualQuery you can just drag it into your query. This is what it usually looks like:

    The above example shows a query from the blog app:

    1. a stream-fallback with 4 in-streams
    2. the first stream which would filter by tag, if the URL had a tag in it - as the test-data has no tag, this stream delivers no results
    3. the second stream filters by author - as the url would have an author (specified in the test-values), it does return items

    The StreamFallback therefor passes on the items provided by the author-filter. Note that while using the VisualQuery, all other streams are also processed to show what's happening. At runtime it will stop processing other streams once it's found a first match.

    Programming With The StreamFallback DataSource

    We recommend to use the VisualQuery where possible, as it's easier to understand and is identical for C# and JavaScript. It's also better because it separates data-retrieval from visualization.

    Read also

    • DataSource / DataStream
    • List of all EAV Data Sources
    • Query / VisualQuery

    Demo App and further links

    You should find some examples in this demo App

    • Demo App with examples for most DataSources

    History

    1. Introduced in EAV 3.x, 2sxc ?

    API Documentation

    Inheritance
    System.Object
    ToSic.Lib.Services.ServiceBase
    ToSic.Lib.Services.ServiceBase<ToSic.Eav.DataSource.DataSourceBase.MyServices>
    DataSourceBase
    StreamFallback
    Implements
    IDataSource
    IAppIdentity
    IZoneIdentity
    IAppIdentityLight
    ICacheKey
    ICacheExpiring
    ITimestamped
    IHasLog
    IDataSourceLinkable
    Inherited Members
    DataSourceBase.AppId
    DataSourceBase.ZoneId
    DataSourceBase.Guid
    DataSourceBase.Error
    DataSourceBase.CacheTimestamp
    DataSourceBase.CacheChanged(Int64)
    DataSourceBase.Configuration
    DataSourceBase.Link
    DataSourceBase.In
    DataSourceBase.TryGetIn(String)
    DataSourceBase.TryGetOut(String)
    DataSourceBase.Out
    DataSourceBase.Item[String]
    DataSourceBase.GetStream(String, String, Boolean, Boolean)
    DataSourceBase.List
    DataSourceBase.Attach(IDataSource)
    DataSourceBase.Attach(String, IDataSource, String)
    DataSourceBase.Attach(String, IDataStream)
    DataSourceBase.ProvideOut(Func<IEnumerable<IEntity>>, String)
    DataSourceBase.ProvideOut(Func<IImmutableList<IEntity>>, String)
    Namespace: ToSic.Eav.DataSources
    Assembly: ToSic.Eav.DataSources.dll
    Syntax
    [PublicApi_Stable_ForUseInYourCode]
    [VisualQuery(NiceName = "Stream Fallback", UiHint = "Find the first stream which has data", Icon = "call_merge", Type = DataSourceType.Logic, NameId = "ToSic.Eav.DataSources.StreamFallback, ToSic.Eav.DataSources", DynamicOut = false, DynamicIn = true, HelpLink = "https://r.2sxc.org/DsStreamFallback")]
    public sealed class StreamFallback : DataSourceBase, IDataSource, IAppIdentity, IZoneIdentity, IAppIdentityLight, ICacheInfo, ICacheKey, ICacheExpiring, ITimestamped, ICanPurgeListCache, IHasLog, IDataTarget, IAppIdentitySync, IDataSourceLinkable
    Remarks

    Had a major, breaking update in v15. Consult the guide to upgrade your custom data sources.

    Implements

    IDataSource
    IAppIdentity
    IZoneIdentity
    IAppIdentityLight
    ICacheKey
    ICacheExpiring
    ITimestamped
    IHasLog
    IDataSourceLinkable
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX