Interface IDataSource
Public interface for an Eav DataSource. All DataSource objects are based on this.
Inherited Members
Namespace: ToSic.Eav.DataSource
Assembly: ToSic.Eav.DataSources.dll
Syntax
[PublicApi_Stable_ForUseInYourCode]
public interface IDataSource : IDataSourceLinkable, IAppIdentity, IZoneIdentity, IAppIdentityLight, ICacheKey, ICacheExpiring, ITimestamped, IHasLog
Properties
| Improve this Doc View SourceConfiguration
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 |
Immutable
Information if the DataSource is Immutable. Reason is that starting in v15, everything should become immutable. So setting parameters or attaching other sources will not be possible any more after initial creation. But because a lot of code is still out there which assumes mutable objects, this is set depending on how the DataSource was created. Newer APIs will result in Immutable DataSources, while older APIs will get you a mutable DataSource. See Convention: Everything is Immutable.
Declaration
bool Immutable { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
New in 15.06
In
List of all In connections.
Declaration
IReadOnlyDictionary<string, IDataStream> In { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<string, IDataStream> | A dictionary of named IDataStream objects, case insensitive |
this[string]
Gets the Out-Stream with specified Name.
Declaration
IDataStream this[string outName] { get; }
Parameters
Type | Name | Description |
---|---|---|
string | outName |
Property Value
Type | Description |
---|---|
IDataStream | an IDataStream of the desired name |
Exceptions
Type | Condition |
---|---|
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 |
---|---|
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
IReadOnlyDictionary<string, IDataStream> Out { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<string, IDataStream> | A dictionary of named IDataStream objects, case insensitive |
Methods
| Improve this Doc View SourceGetStream(string, string, bool, bool)
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://go.2sxc.org/named-params)", bool nullIfNotFound = false, bool emptyIfNotFound = false)
Parameters
Type | Name | Description |
---|---|---|
string | name | The desired stream name. If empty, will default to the default stream. |
string | noParamOrder | |
bool | nullIfNotFound | In case the stream |
bool | 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 |
---|---|
NullReferenceException | if the stream does not exist and |