Class CustomDataSourceAdvanced
- Namespace
- ToSic.Eav.DataSource
- Assembly
- ToSic.Eav.DataSource.dll
The base class for all DataSources, especially custom DataSources. It must always be inherited. It provides a lot of core functionality to get configurations, ensure caching and more.
Important: in most cases you will inherit the CustomDataSource DataSource for custom data sources.
[PublicApi]
public abstract class CustomDataSourceAdvanced : DataSourceBase, IDataSource, IAppIdentity, IZoneIdentity, IAppIdentityLight, ICacheKey, ICacheExpiring, ITimestamped, IHasLog, IDataSourceLinkable
- Inheritance
-
objectCustomDataSourceAdvanced
- Implements
- Derived
- Inherited Members
Remarks
Had a major, breaking update in v15. Consult the guide to upgrade your custom data sources.
Constructors
CustomDataSourceAdvanced(Dependencies, string?, object[]?)
Initializes an DataSource which will usually provide/generate external data.
protected CustomDataSourceAdvanced(CustomDataSourceAdvanced.Dependencies services, string? logName = null, object[]? connect = null)
Parameters
services
CustomDataSourceAdvanced.DependenciesDependencies needed by this data source and/or the parent
logName
stringThe log name/identifier for insights logging. Optional, but makes debugging a bit easier when provided.
connect
object[]
Remarks
set the cache creation date to the moment the object is constructed this is important, because the date should stay fixed throughout the lifetime of this object but renew when it is updates
Properties
CacheTimestamp
System time-stamp of when the data in this cached thing was initialized or updated. Depending on the implementation, this may go up-stream and return an up-stream value.
public override long CacheTimestamp { get; }
Property Value
- long
A timestamp as a long number
DataFactory
[PublicApi]
protected IDataFactory DataFactory { get; }