Interface IDataSourceSource
Public interface for an Eav DataSource. All DataSource objects are based on this.
Inherited Members
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 SourceCacheKey
Declaration
ICacheKeyManager CacheKey { get; }
Property Value
Type | Description |
---|---|
ICacheKeyManager |
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> |
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 |
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 |
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 |
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. |
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 SourceGetStream(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 | |
System.Boolean | nullIfNotFound | In case the stream |
System.Boolean | emptyIfNotFound | In case the stream |
Returns
Type | Description |
---|---|
IDataStream | an IDataStream of the desired name |
Remarks
- Added in 2sxc 12.05
- 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 |