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

    Show / Hide Table of Contents

    Interface IDataSourceSource

    Public interface for an Eav DataSource. All DataSource objects are based on this.

    Inherited Members
    IDataSourceShared.Guid
    IDataSourceShared.Name
    IZoneIdentity.ZoneId
    IAppIdentityLight.AppId
    ICacheKey.CachePartialKey
    ICacheKey.CacheFullKey
    ICacheExpiring.CacheChanged(Int64)
    ITimestamped.CacheTimestamp
    ICanPurgeListCache.PurgeList(Boolean)
    IHasLog.Log
    Namespace: ToSic.Eav.DataSources
    Assembly: ToSic.Eav.DataSources.dll
    Syntax
    [PublicApi_Stable_ForUseInYourCode]
    public interface IDataSourceSource : IDataSourceShared, IAppIdentity, IZoneIdentity, IAppIdentityLight, ICacheInfo, ICacheKey, ICacheExpiring, ITimestamped, ICanPurgeListCache, IHasLog

    Properties

    | Improve this Doc View Source

    CacheKey

    Declaration
    ICacheKeyManager CacheKey { get; }
    Property Value
    Type Description
    ICacheKeyManager
    | Improve this Doc View Source

    CacheRelevantConfigurations

    Some configuration of the data source is cache-relevant, others are not. This list contains the names of all configuration items which are cache relevant. It will be used when generating a unique ID for caching the data.

    Declaration
    List<string> CacheRelevantConfigurations { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<System.String>
    | Improve this Doc View Source

    Configuration

    The configuration system of this data source. Keeps track of all values which the data source will need, and manages the LookUp engine which provides these values.

    Declaration
    IDataSourceConfiguration Configuration { get; }
    Property Value
    Type Description
    IDataSourceConfiguration
    | Improve this Doc View Source

    Error

    Special helper to generate error-streams.

    DataSources should never throw exceptions but instead return a stream containing the error information.

    Declaration
    DataSourceErrorHelper Error { get; }
    Property Value
    Type Description
    DataSourceErrorHelper
    | Improve this Doc View Source

    Item[String]

    Gets the Out-Stream with specified Name.

    Declaration
    IDataStream this[string outName] { get; }
    Parameters
    Type Name Description
    System.String outName
    Property Value
    Type Description
    IDataStream

    an IDataStream of the desired name

    Exceptions
    Type Condition
    System.NullReferenceException

    if the stream does not exist

    | Improve this Doc View Source

    List

    The items in the data-source - to be exact, the ones in the Default stream.

    Declaration
    IEnumerable<IEntity> List { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<IEntity>

    A list of IEntity items in the Default stream.

    | Improve this Doc View Source

    Out

    Gets the Dictionary of Out-Streams. This is the internal accessor, as usually you'll use this["name"] instead.
    In rare cases you need the Out, for example to list the stream names in the data source.

    Declaration
    IDictionary<string, IDataStream> Out { get; }
    Property Value
    Type Description
    System.Collections.Generic.IDictionary<System.String, IDataStream>

    A dictionary of named IDataStream objects

    Methods

    | Improve this Doc View Source

    GetStream(String, String, Boolean, Boolean)

    Gets the Out-Stream with specified Name and allowing some error handling if not found.

    Declaration
    IDataStream GetStream(string name = null, string noParamOrder = "Params must be named (https://r.2sxc.org/named-params)", bool nullIfNotFound = false, bool emptyIfNotFound = false)
    Parameters
    Type Name Description
    System.String name

    The desired stream name. If empty, will default to the default stream.

    System.String noParamOrder

    see Convention: Named Parameters

    System.Boolean nullIfNotFound

    In case the stream name isn't found, will return null. Ideal for chaining with ??

    System.Boolean emptyIfNotFound

    In case the stream name isn't found, will return an empty stream. Ideal for using LINQ directly.

    Returns
    Type Description
    IDataStream

    an IDataStream of the desired name

    Remarks
    1. Added in 2sxc 12.05
    2. for more in-depth checking if a stream exists, you can access the Out which is an IDictionary
    Exceptions
    Type Condition
    System.NullReferenceException

    if the stream does not exist and nullIfNotFound is false

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX